CVE-2024-36120: Js deobfuscator Javascript-deobfuscator Crafted Payload Can Lead Vulnerability

HIGH
Advisory Identifier: GHSA-9p6p-8v9r-8c9m
CVSS 8.1
CWE-94
Published
Advisory Summary

CVE-2024-36120 is a HIGH (CVSS 8.1) javascript-deobfuscator crafted payload can lead vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Js deobfuscator libraries in the npm ecosystem. The issue involves javascript-deobfuscator crafted payload can lead to code execution. Remediation is available by upgrading affected packages to version 1.1.0.

CVE-2024-36120 at a Glance

CVE Identifier CVE-2024-36120
GHSA Identifier GHSA-9p6p-8v9r-8c9m
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Js deobfuscator
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-36120

To remediate this vulnerability, upgrade all affected Js deobfuscator dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

js-deobfuscator fixed: 1.1.0
npm install js-deobfuscator@1.1.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls js-deobfuscator

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-36120, inspect your project dependencies using npm:

npm ls js-deobfuscator

Analyze the terminal output to locate any version of Js deobfuscator in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.0), your application is affected.

Note: The npm ls js-deobfuscator command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Js deobfuscator, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

javascript-deobfuscator removes common JavaScript obfuscation techniques. Crafted payloads targeting expression simplification can lead to code execution. This issue has been patched in version 1.1.0.

CVE-2024-36120 Affected Js deobfuscator Versions

1 component(s)
Fixed Versions:
1.1.0
Product / Package Ecosystem Affected Versions Fixed Version
js-deobfuscator
npm
< 1.1.0
1.1.0

References

Frequently Asked Questions

What is CVE-2024-36120?
CVE-2024-36120 is a security vulnerability in Js deobfuscator involving javascript-deobfuscator crafted payload can lead to code execution under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Js deobfuscator versions are affected?
Affected versions include releases prior to 1.1.0 across affected packages: js-deobfuscator.
What version fixes CVE-2024-36120?
Upgrading to 1.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is js-deobfuscator affected?
Yes, js-deobfuscator is affected in releases prior to 1.1.0. Upgrade your dependency to 1.1.0 or later.
What is the CVSS score of CVE-2024-36120?
CVE-2024-36120 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2024-36120?
CVE-2024-36120 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2024-36120?
Run the dependency tree command: 'npm ls js-deobfuscator'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9p6p-8v9r-8c9m",
  "modified" : "2024-06-04T15:13:54Z",
  "published" : "2024-06-04T15:13:54Z",
  "aliases" : [ "CVE-2024-36120" ],
  "summary" : "javascript-deobfuscator crafted payload can lead to code execution",
  "details" : "javascript-deobfuscator removes common JavaScript obfuscation techniques. Crafted payloads targeting expression simplification can lead to code execution. This issue has been patched in version 1.1.0.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "js-deobfuscator"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ben-sb/javascript-deobfuscator/security/advisories/GHSA-9p6p-8v9r-8c9m"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-36120"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ben-sb/javascript-deobfuscator/commit/630d3caec83d5f31c5f7a07e6fadf613d06699d6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ben-sb/javascript-deobfuscator"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-04T15:13:54Z",
    "nvd_published_at" : "2024-05-31T17:15:09Z"
  }
}