GHSA-4p39-36wj-23h4

Suggest an improvement
Source
https://github.com/advisories/GHSA-4p39-36wj-23h4
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-4p39-36wj-23h4/GHSA-4p39-36wj-23h4.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-4p39-36wj-23h4
Aliases
  • CVE-2026-126063
Published
2026-11-10T20:47:36Z
Modified
2026-11-10T21:00:04Z
Severity
  • 2.3 (Low) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N CVSS Calculator
Summary
Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer
Details

Summary

Nokogiri's HTML5 serializer did not escape text inside noscript elements, or < and > inside attribute values. When a document parsed with the default options is serialized, a browser with scripting enabled can parse the output into markup that Nokogiri's parser never produced. This is a mutation XSS for applications that sanitize untrusted HTML with Nokogiri::HTML5, allow noscript elements, and send the serialized output to browsers.

Nokogiri 1.19.5 escapes both, as the HTML standard's serialization algorithm requires. Text inside noscript is still emitted unescaped for documents parsed with parse_noscript_content_as_text: true.

Only the C extension (CRuby and TruffleRuby) is affected. JRuby does not implement Nokogiri::HTML5.

Severity

The Nokogiri maintainers have evaluated this as low severity (CVSS 2.3, CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N). Exploitation requires an application that allows noscript in sanitized HTML. Loofah and rails-html-sanitizer do not allow it by default, and Sanitize always removes it.

Mitigation

Upgrade to Nokogiri 1.19.5 or later.

Applications that sanitize HTML and allow noscript should parse with parse_noscript_content_as_text: true (available since Nokogiri 1.17.0), or remove noscript elements. This is the workaround for earlier versions, and it is recommended on every version: some content inside noscript is serialized unchanged, as the standard requires.

Credit

This issue was responsibly reported by @a-zara-n.

Database specific
{
    "cwe_ids": [
        "CWE-116",
        "CWE-79"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-10T20:47:36Z",
    "nvd_published_at": null,
    "severity": "LOW"
}
References

Affected packages

RubyGems / nokogiri

Package

Name
nokogiri
Purl
pkg:gem/nokogiri

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.12.0
Fixed
1.19.5

Affected versions

1.*
1.12.0
1.12.1
1.12.2
1.12.3
1.12.4
1.12.5
1.13.0
1.13.1
1.13.2
1.13.3
1.13.4
1.13.5
1.13.6
1.13.7
1.13.8
1.13.9
1.13.10
1.14.0.rc1
1.14.0
1.14.1
1.14.2
1.14.3
1.14.4
1.14.5
1.15.0
1.15.1
1.15.2
1.15.3
1.15.4
1.15.5
1.15.6
1.15.7
1.16.0.rc1
1.16.0
1.16.1
1.16.2
1.16.3
1.16.4
1.16.5
1.16.6
1.16.7
1.16.8
1.17.0
1.17.1
1.17.2
1.18.0.rc1
1.18.0
1.18.1
1.18.2
1.18.3
1.18.4
1.18.5
1.18.6
1.18.7
1.18.8
1.18.9
1.18.10
1.19.0
1.19.1
1.19.2
1.19.3
1.19.4

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-4p39-36wj-23h4/GHSA-4p39-36wj-23h4.json"