Use After Free Affecting nokogiri package, versions <1.19.5


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.16% (5th 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-22409038
  • published11 Nov 2026
  • disclosed10 Nov 2026
  • creditUnknown

Introduced: 10 Nov 2026

NewCVE-2026-126064  (opens in a new tab)
CWE-416  (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 Use After Free in the Nokogiri::XML::Node#[]= and Nokogiri::XML::Node#lang= methods. Replacing the value of an existing attribute whose child nodes were already accessed frees those native child nodes while their Ruby wrappers remain reachable, and using one of those nodes afterwards reads freed memory and can crash the process. Exposure requires application code that accesses an attribute's child nodes and then replaces the value of that same attribute, an unusual usage pattern, and only the CRuby native extension is affected.

CVSS Base Scores

version 4.0
version 3.1