CVE-2022-25139
NGINX vulnerability analysis and mitigation

Overview

njs through 0.7.0, used in NGINX, was discovered to contain a heap use-after-free vulnerability in njsawaitfulfilled. The vulnerability was identified and disclosed in December 2021 (Github Issue).

Technical details

The vulnerability is a heap use-after-free issue that occurs in the njsawaitfulfilled function. The issue arises because the PromiseCapability record was stored directly in the function object during function invocation, which is incorrect as the PromiseCapability record should be linked to the current execution context. This results in the function->context being overwritten with consecutive recursive calls, leading to use-after-free (Github Commit). The vulnerability has been assigned a CVSS score of 9.8 (CRITICAL) with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (NetApp Advisory).

Impact

Successful exploitation of this vulnerability could lead to disclosure of sensitive information, addition or modification of data, or Denial of Service (DoS) (NetApp Advisory).

Mitigation and workarounds

The issue has been fixed in later versions of njs by modifying how the PromiseCapability record is handled during function execution. The fix ensures that the PromiseCapability record is properly linked to the current execution context rather than being stored directly in the function object (Github Commit).

Additional resources


SourceThis report was generated using AI

Related NGINX vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2024-33452HIGH7.7
  • NGINXNGINX
  • libnginx-mod-http-lua
NoYesApr 22, 2025
CVE-2025-1695MEDIUM6.9
  • NGINXNGINX
  • cpe:2.3:a:f5:nginx
NoYesMar 04, 2025
CVE-2025-53859MEDIUM6.3
  • NGINXNGINX
  • nginx:1.22::nginx-all-modules
NoYesAug 13, 2025
CVE-2024-7347MEDIUM5.7
  • NGINXNGINX
  • nginx:1.22::nginx-all-modules
NoYesAug 14, 2024
CVE-2025-23419MEDIUM5.3
  • NGINXNGINX
  • nginx-mod-fancyindex
NoYesFeb 05, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management