Skip to content
High 8.6

happy-domで信頼できないHTMLの解析時に内部ネットワークへのサーバー側リクエストが発生する脆弱性

CVE-2026-118660 First seen on SecPulse

Summary

happy-domでは、信頼できないHTMLを解析する際に、iframeやlinkタグのstylesheetに指定されたURLへサーバー側から自動的にリクエストが送られます。攻撃者が解析されるHTMLを用意できる場合、内部ネットワークやクラウドのエンドポイントへ接続させられ、返ってきた応答や認証情報が漏れるおそれがあります。影響するのは21.0.0より前のバージョンで、21.0.0に修正版が公開されています。アプリケーションでnpmの利用している場合は、21.0.0以降へ更新してください。

AI summary

Written by an external AI model and may contain mistakes. Check the original description and references below before acting on it.

happy-domでは、信頼できないHTMLを解析する際に、iframeやlinkタグのstylesheetに指定されたURLへサーバー側から自動的にリクエストが送られます。攻撃者が解析されるHTMLを用意できる場合、内部ネットワークやクラウドのエンドポイントへ接続させられ、返ってきた応答や認証情報が漏れるおそれがあります。影響するのは21.0.0より前のバージョンで、21.0.0に修正版が公開されています。アプリケーションでnpmの利用している場合は、21.0.0以降へ更新してください。

Affected packages

EcosystemPackageAffectedFixed
capricorn86 happy-dom — —
npm happy-dom
< 21.0.0
21.0.0
Original description The description as published by the source.

Summary

happy-dom v20.8.9 makes real server-side HTTP requests to arbitrary URLs when parsing HTML containing or 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.

Affected Versions

  • happy-dom <= 20.8.9 (latest)

Vulnerable Behavior

By default, happy-dom has:

  • disableIframePageLoading: false — iframes fetch their src URL via real HTTP requests
  • disableCSSFileLoading: false — `` 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.

Proof of Concept

Verified test (attacker server receives requests):

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('stolen');
});

srv.listen(9995, () => {
    // iframe SSRF — happy-dom makes a real GET request
    const win1 = new Window({ url: 'http://localhost' });
    win1.document.write('');

    // stylesheet SSRF — happy-dom makes a real GET request
    const win2 = new Window({ url: 'http://loc…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details