Improper Encoding or Escaping of Output Affecting nokogiri package, versions >=1.12.0, <1.19.5


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.56% (48th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUBY-NOKOGIRI-22409035
  • published11 Nov 2026
  • disclosed10 Nov 2026
  • creditUnknown

Introduced: 10 Nov 2026

NewCVE-2026-126063  (opens in a new tab)
CWE-116  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

Upgrade nokogiri to version 1.19.5 or higher.

Overview

nokogiri is a gem for parsing HTML, XML, SAX, and Reader.

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output in the Nokogiri::HTML5 serializer, which does not escape text inside noscript elements or < and > in attribute values. An attacker can execute script in the browser of a user by supplying HTML that a browser with scripting enabled parses into markup that the Nokogiri parser never produced. Only applications that sanitize untrusted HTML with Nokogiri::HTML5, allow noscript elements, and send the serialized output to browsers are exposed, and Loofah and rails-html-sanitizer do not allow noscript by default.

Workaround

This vulnerability can be avoided by parsing with the parse_noscript_content_as_text: true option, which is available since version 1.17.0.

CVSS Base Scores

version 4.0
version 3.1