CVE-2026-33943: CWE-94: Improper Control of Generation of Code ('Code Injection') in capricorn86 happy-dom
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. In versions 15.10.0 through 20.8.7, 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. Version 20.8.8 fixes the issue.
AI Analysis
Technical Summary
CVE-2026-33943 is a high-severity code injection vulnerability (CWE-94) in the capricorn86 happy-dom JavaScript environment. The ECMAScriptModuleCompiler improperly controls code generation by directly interpolating unsanitized input into executable code within export { } declarations of ES modules. The sanitization mechanism fails to strip backticks, allowing attackers to craft payloads using template literals that bypass filters and achieve remote code execution. This affects happy-dom versions from 15.10.0 up to and including 20.8.7. The issue is fixed in version 20.8.8. The vulnerability has a CVSS 3.1 score of 8.8, indicating high impact on confidentiality, integrity, and availability.
Potential Impact
Successful exploitation allows an unauthenticated attacker to execute arbitrary JavaScript code remotely within the context of happy-dom by injecting malicious expressions into ES module export declarations. This leads to full compromise of the affected environment's confidentiality, integrity, and availability.
Mitigation Recommendations
An official fix is available in happy-dom version 20.8.8. Users should upgrade to version 20.8.8 or later to remediate this vulnerability. No additional mitigation steps are indicated by the vendor advisory.
CVE-2026-33943: CWE-94: Improper Control of Generation of Code ('Code Injection') in capricorn86 happy-dom
Description
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. In versions 15.10.0 through 20.8.7, 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. Version 20.8.8 fixes the issue.
CVSS v3.1
Score 8.8high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-33943 is a high-severity code injection vulnerability (CWE-94) in the capricorn86 happy-dom JavaScript environment. The ECMAScriptModuleCompiler improperly controls code generation by directly interpolating unsanitized input into executable code within export { } declarations of ES modules. The sanitization mechanism fails to strip backticks, allowing attackers to craft payloads using template literals that bypass filters and achieve remote code execution. This affects happy-dom versions from 15.10.0 up to and including 20.8.7. The issue is fixed in version 20.8.8. The vulnerability has a CVSS 3.1 score of 8.8, indicating high impact on confidentiality, integrity, and availability.
Potential Impact
Successful exploitation allows an unauthenticated attacker to execute arbitrary JavaScript code remotely within the context of happy-dom by injecting malicious expressions into ES module export declarations. This leads to full compromise of the affected environment's confidentiality, integrity, and availability.
Mitigation Recommendations
An official fix is available in happy-dom version 20.8.8. Users should upgrade to version 20.8.8 or later to remediate this vulnerability. No additional mitigation steps are indicated by the vendor advisory.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-03-24T19:50:52.104Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Vendor Advisory Urls
- [{"url":"https://access.redhat.com/security/cve/CVE-2026-33943","vendor":"Red Hat"}]
Threat ID: 69c6f6ca3c064ed76ff81bae
Added to database: 03/27/2026, 21:29:46 UTC
Last enriched: 07/15/2026, 09:01:02 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 137
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.