{"id":"CVE-2026-126063","aliases":[],"url":"https://o3.security/vulnerability/CVE-2026-126063","summary":"Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer","details":"### Summary\n\nNokogiri'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.\n\nNokogiri 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`.\n\nOnly the C extension (CRuby and TruffleRuby) is affected. JRuby does not implement `Nokogiri::HTML5`.\n\n### Severity\n\nThe 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.\n\n### Mitigation\n\nUpgrade to Nokogiri 1.19.5 or later.\n\nApplications 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.\n\n### Credit\n\nThis issue was responsibly reported by @a-zara-n.","published":"2026-11-10T20:47:36Z","modified":"2026-11-10T21:00:04.024722735Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"RubyGems","name":"nokogiri","fixedVersion":"1.19.5"}],"fix":{"url":"https://github.com/sparklemotion/nokogiri/pull/3752","label":"sparklemotion/nokogiri#3752"},"references":[{"type":"WEB","url":"https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-4p39-36wj-23h4"},{"type":"WEB","url":"https://github.com/sparklemotion/nokogiri/pull/3752"},{"type":"WEB","url":"https://github.com/sparklemotion/nokogiri/commit/3e84df6ff7ab4d78f446e3a415430bd69a055d32"},{"type":"WEB","url":"https://github.com/sparklemotion/nokogiri/commit/c6c0bffbdcd194694995acafeeed27326b0805f8"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/GHSA-4p39-36wj-23h4.yml"},{"type":"PACKAGE","url":"https://github.com/sparklemotion/nokogiri"},{"type":"WEB","url":"https://github.com/sparklemotion/nokogiri/releases/tag/v1.19.5"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-11-10T21:00:04.024722735Z"}}