Access of Resource Using Incompatible Type ('Type Confusion') Affecting ruby-nokogiri package, versions <1.13.6-r0


Severity

Recommended
0.0
high
0
10

Snyk's Security Team recommends NVD's CVSS assessment. Learn more

Threat Intelligence

EPSS
5.34% (90th 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 Access of Resource Using Incompatible Type ('Type Confusion') vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-ALPINE322-RUBYNOKOGIRI-10283089
  • published31 May 2025
  • disclosed20 May 2022

Introduced: 20 May 2022

CVE-2022-29181  (opens in a new tab)
CWE-843  (opens in a new tab)

How to fix?

Upgrade Alpine:3.22 ruby-nokogiri to version 1.13.6-r0 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream ruby-nokogiri package and not the ruby-nokogiri package as distributed by Alpine. See How to fix? for Alpine:3.22 relevant fixed versions and status.

Nokogiri is an open source XML and HTML library for Ruby. Nokogiri prior to version 1.13.6 does not type-check all inputs into the XML and HTML4 SAX parsers, allowing specially crafted untrusted inputs to cause illegal memory access errors (segfault) or reads from unrelated memory. Version 1.13.6 contains a patch for this issue. As a workaround, ensure the untrusted input is a String by calling #to_s or equivalent.

CVSS Base Scores

version 3.1