Use After Free Affecting nokogiri package, versions <1.13.2


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.54% (78th 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 Learn

Learn about Use After Free vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUBY-NOKOGIRI-2413994
  • published23 Feb 2022
  • disclosed20 Feb 2022
  • creditShinji Sato

Introduced: 20 Feb 2022

CVE-2022-23308  (opens in a new tab)
CWE-416  (opens in a new tab)

How to fix?

Upgrade nokogiri to version 1.13.2 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 via the ID and IDREF attributes, when using the xmlReader interface with validation or when a document is parsed with XML_PARSE_DTDVALID and without XML_PARSE_NOENT. This can lead to the value of ID attributes to not be normalized after potentially expanding entities in xmlRemoveID, which will cause later calls to xmlGetID to return a pointer to previously freed memory.

CVSS Scores

version 3.1