Every CVE Search/ Get API key

CVE-2022-29181

Improper Handling of Unexpected Data Type in Nokogiri

8.2 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
Low
Integrity
None
Availability
High

Exploit likelihood

3.23%Up 2.3 points since May 21, 2022
90%50%10%1%

What each source reports

CVE List Score used 8.2

Improper Handling of Unexpected Data Type in Nokogiri

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.

Record
CVE-2022-29181
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
Weakness
CWE-241
Updated
2026-11-02
EUVDEUVD-2022-5789 8.2

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.

Record
EUVD-2022-5789
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-xh29-r2w5-wx8m 8.2

Nokogiri Improperly Handles Unexpected Data Type

Summary

Nokogiri < v1.13.6 does not type-check all inputs into the XML and HTML4 SAX parsers. For CRuby users, this may allow specially crafted untrusted inputs to cause illegal memory access errors (segfault) or reads from unrelated memory.

Severity

The Nokogiri maintainers have evaluated this as High 8.2 (CVSS3.1).

Mitigation

CRuby users should upgrade to Nokogiri >= 1.13.6.

JRuby users are not affected.

Workarounds

To avoid this vulnerability in affected applications, ensure the untrusted input is a String by calling #to_s or equivalent.

Credit

This vulnerability was responsibly reported by @agustingianni and the Github Security Lab.

Record
GHSA-xh29-r2w5-wx8m
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
Weakness
CWE-241, CWE-843
Updated
2026-11-02
NVD 8.2

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.

Record
CVE-2022-29181
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
CVSS 2.0
6.4 MediumAV:N/AC:L/Au:N/C:P/I:N/A:P
Weakness
CWE-241, CWE-843
Updated
2026-11-02
OSVALPINE-CVE-2022-29181 8.2

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.

Record
ALPINE-CVE-2022-29181
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
Updated
2026-11-03
OSVBELL-CVE-2022-29181 8.2

CVE-2022-29181 does not affect BellSoft software

Record
BELL-CVE-2022-29181
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
Updated
2026-11-02
Show 15 moreShow less
OSV 8.2

Improper Handling of Unexpected Data Type in Nokogiri

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.

Record
CVE-2022-29181
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
Weakness
CWE-241
Updated
2026-11-02
OSVGHSA-xh29-r2w5-wx8m 8.2

Nokogiri Improperly Handles Unexpected Data Type

Summary

Nokogiri < v1.13.6 does not type-check all inputs into the XML and HTML4 SAX parsers. For CRuby users, this may allow specially crafted untrusted inputs to cause illegal memory access errors (segfault) or reads from unrelated memory.

Severity

The Nokogiri maintainers have evaluated this as High 8.2 (CVSS3.1).

Mitigation

CRuby users should upgrade to Nokogiri >= 1.13.6.

JRuby users are not affected.

Workarounds

To avoid this vulnerability in affected applications, ensure the untrusted input is a String by calling #to_s or equivalent.

Credit

This vulnerability was responsibly reported by @agustingianni and the Github Security Lab.

Record
GHSA-xh29-r2w5-wx8m
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
Weakness
CWE-241, CWE-843
Updated
2026-11-02
OSVRHSA-2022:8506 9.8

Red Hat Security Advisory: Satellite 6.12 Release

Record
RHSA-2022:8506
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2022-29181 8.2

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.

Record
UBUNTU-CVE-2022-29181
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2022-29181 No score

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.

Record
DEBIAN-CVE-2022-29181
Updated
2026-11-03
OSVMGASA-2022-0200 No score

Updated ruby-nokogiri packages fix security vulnerability

Nokogiri did 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.

Record
MGASA-2022-0200
Updated
2026-11-02
OSVopenSUSE-SU-2024:12085-1 No score

ruby3.1-rubygem-nokogiri-1.13.6-1.1 on GA media

These are all security issues fixed in the ruby3.1-rubygem-nokogiri-1.13.6-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:12085-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:13165-1 No score

ruby3.2-rubygem-nokogiri-1.13.9-1.7 on GA media

These are all security issues fixed in the ruby3.2-rubygem-nokogiri-1.13.9-1.7 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:13165-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:14174-1 No score

ruby3.3-rubygem-nokogiri-1.15.5-1.5 on GA media

These are all security issues fixed in the ruby3.3-rubygem-nokogiri-1.15.5-1.5 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:14174-1
Updated
2026-11-02
OSVopenSUSE-SU-2025:14697-1 No score

ruby3.4-rubygem-nokogiri-1.18.2-1.1 on GA media

These are all security issues fixed in the ruby3.4-rubygem-nokogiri-1.18.2-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2025:14697-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:10356-1 No score

ruby4.0-rubygem-nokogiri-1.18.9-1.4 on GA media

These are all security issues fixed in the ruby4.0-rubygem-nokogiri-1.18.9-1.4 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:10356-1
Updated
2026-11-02
OSVSUSE-SU-2022:3890-1 No score

Security update for rubygem-nokogiri

This update for rubygem-nokogiri fixes the following issues:

  • CVE-2022-24836: Fixes possibility to DoS because of inefficient RE in HTML encoding. (bsc#1198408)
  • CVE-2022-29181: Fixes Improper Handling of Unexpected Data Typesi. (bsc#1199782)
Record
SUSE-SU-2022:3890-1
Updated
2026-11-02
OSVSUSE-SU-2022:4015-1 No score

Security update for rubygem-nokogiri

This update for rubygem-nokogiri fixes the following issues:

  • CVE-2022-24836: Fixes possibility to DoS because of inefficient RE in HTML encoding. (bsc#1198408)
  • CVE-2022-29181: Fixes Improper Handling of Unexpected Data Typesi. (bsc#1199782)
Record
SUSE-SU-2022:4015-1
Updated
2026-11-02
OSVSUSE-SU-2022:4016-1 No score

Security update for rubygem-nokogiri

This update for rubygem-nokogiri fixes the following issues:

  • CVE-2022-24836: Fixes possibility to DoS because of inefficient RE in HTML encoding. (bsc#1198408)
  • CVE-2022-29181: Fixes Improper Handling of Unexpected Data Typesi. (bsc#1199782)
Record
SUSE-SU-2022:4016-1
Updated
2026-11-02
OSVUSN-7659-1 No score

ruby-nokogiri vulnerabilities

It was discovered Nokogiri did not correctly parse XML Schemas. If a user or automated system were tricked into opening a specially crafted file, an attacker could possibly use this issue to execute arbitrary code. This issue only affected Ubuntu 20.04 LTS. (CVE-2020-26247)

Agustin Gianni discovered that Nokogiri did not correctly parse XML and HTML files. If a user or automated system were tricked into opening a specially crafted file, an attacker could possibly use this issue to cause a denial of service or leak sensitive information. (CVE-2022-29181)

Record
USN-7659-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
nokogiri
RubyGems
before 1.13.6
1.13.6
ruby-nokogiri
Alpine:v3.16
before 1.13.6-r0
1.13.6-r0
ruby-nokogiri
Alpine:v3.17
before 1.13.6-r0
1.13.6-r0
ruby-nokogiri
Alpine:v3.18
before 1.13.6-r0
1.13.6-r0
ruby-nokogiri
Alpine:v3.19
before 1.13.6-r0
1.13.6-r0
ruby-nokogiri
Alpine:v3.20
before 1.13.6-r0
1.13.6-r0
ruby-nokogiri
Alpine:v3.21
before 1.13.6-r0
1.13.6-r0
ruby-nokogiri
Alpine:v3.22
before 1.13.6-r0
1.13.6-r0
ruby-nokogiri
Alpine:v3.23
before 1.13.6-r0
1.13.6-r0
ruby-nokogiri
Alpine:v3.24
before 1.13.6-r0
1.13.6-r0
Show 55 moreShow less
Affected packages
PackageAffectedFixed
ruby-nokogiri
Debian:12
before 1.13.7+dfsg-1
1.13.7+dfsg-1
ruby-nokogiri
Debian:13
before 1.13.7+dfsg-1
1.13.7+dfsg-1
ruby-nokogiri
Debian:14
before 1.13.7+dfsg-1
1.13.7+dfsg-1
nokogiri
RubyGems
before 1.13.6, plus listed versions
1.0.01.0.11.0.21.0.31.0.4
Show 45 moreShow less
1.0.51.0.61.0.71.1.01.1.11.10.01.10.0.rc11.10.11.10.101.10.21.10.31.10.41.10.51.10.61.10.71.10.81.10.91.11.01.11.0.rc11.11.0.rc21.11.0.rc31.11.0.rc41.11.11.11.21.11.31.11.41.11.51.11.61.11.71.12.01.12.0.rc11.12.11.12.21.12.31.12.41.12.51.13.01.13.11.13.21.13.31.13.41.13.51.2.01.2.11.2.2
1.13.6
ruby-nokogiri
Mageia:8
before 1.11.7-1.1.mga8
1.11.7-1.1.mga8
candlepin
Red Hat:satellite:6.12::el8
before 0:4.1.15-1.el8sat
0:4.1.15-1.el8sat
candlepin-selinux
Red Hat:satellite:6.12::el8
before 0:4.1.15-1.el8sat
0:4.1.15-1.el8sat
python-django
Red Hat:satellite_capsule:6.12::el8
before 0:3.2.14-2.el8pc
0:3.2.14-2.el8pc
python39-django
Red Hat:satellite_capsule:6.12::el8
before 0:3.2.14-2.el8pc
0:3.2.14-2.el8pc
python-django
Red Hat:satellite:6.12::el8
before 0:3.2.14-2.el8pc
0:3.2.14-2.el8pc
python39-django
Red Hat:satellite:6.12::el8
before 0:3.2.14-2.el8pc
0:3.2.14-2.el8pc
rubygem-nokogiri
Red Hat:satellite_capsule:6.12::el8
before 0:1.13.8-1.el8sat
0:1.13.8-1.el8sat
rubygem-nokogiri-debuginfo
Red Hat:satellite_capsule:6.12::el8
before 0:1.13.8-1.el8sat
0:1.13.8-1.el8sat
rubygem-nokogiri-debugsource
Red Hat:satellite_capsule:6.12::el8
before 0:1.13.8-1.el8sat
0:1.13.8-1.el8sat
rubygem-nokogiri
Red Hat:satellite:6.12::el8
before 0:1.13.8-1.el8sat
0:1.13.8-1.el8sat
rubygem-nokogiri-debuginfo
Red Hat:satellite:6.12::el8
before 0:1.13.8-1.el8sat
0:1.13.8-1.el8sat
rubygem-nokogiri-debugsource
Red Hat:satellite:6.12::el8
before 0:1.13.8-1.el8sat
0:1.13.8-1.el8sat
rubygem-git
Red Hat:satellite:6.12::el8
before 0:1.11.0-1.el8sat
0:1.11.0-1.el8sat
rubygem-sinatra
Red Hat:satellite_capsule:6.12::el8
before 1:2.2.0-1.el8sat
1:2.2.0-1.el8sat
rubygem-sinatra
Red Hat:satellite:6.12::el8
before 1:2.2.0-1.el8sat
1:2.2.0-1.el8sat
rubygem-rails-html-sanitizer
Red Hat:satellite:6.12::el8
before 0:1.4.3-2.el8sat
0:1.4.3-2.el8sat
foreman
Red Hat:satellite_capsule:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-debug
Red Hat:satellite_capsule:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman
Red Hat:satellite_utils:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-cli
Red Hat:satellite_utils:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-cli
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-debug
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-dynflow-sidekiq
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-ec2
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-gce
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-journald
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-libvirt
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-openstack
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-ovirt
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-postgresql
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-service
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-telemetry
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
foreman-vmware
Red Hat:satellite:6.12::el8
before 0:3.3.0.17-1.el8sat
0:3.3.0.17-1.el8sat
rubygem-nokogiri
SUSE:OpenStack Cloud Crowbar 8
before 1.6.1-5.6.1
1.6.1-5.6.1
rubygem-nokogiri
SUSE:OpenStack Cloud Crowbar 9
before 1.6.1-5.6.1
1.6.1-5.6.1
rubygem-nokogiri
SUSE:Linux Enterprise Module for Basesystem 15 SP3
before 1.8.5-150000.3.9.1
1.8.5-150000.3.9.1
rubygem-nokogiri
SUSE:Linux Enterprise High Availability Extension 15
before 1.8.5-150000.3.9.1
1.8.5-150000.3.9.1
rubygem-nokogiri
SUSE:Linux Enterprise High Availability Extension 15 SP1
before 1.8.5-150000.3.9.1
1.8.5-150000.3.9.1
rubygem-nokogiri
SUSE:Linux Enterprise High Availability Extension 15 SP2
before 1.8.5-150000.3.9.1
1.8.5-150000.3.9.1
rubygem-nokogiri
openSUSE:Leap 15.3
before 1.8.5-150000.3.9.1
1.8.5-150000.3.9.1
rubygem-nokogiri
SUSE:Linux Enterprise Module for Basesystem 15 SP4
before 1.8.5-150400.14.3.1
1.8.5-150400.14.3.1
rubygem-nokogiri
openSUSE:Leap 15.4
before 1.8.5-150400.14.3.1
1.8.5-150400.14.3.1
ruby-nokogiri
Ubuntu:Pro:20.04:LTS
before 1.10.7+dfsg1-2ubuntu0.1~esm2, plus listed versions
1.10.3+dfsg1-21.10.4+dfsg1-11.10.7+dfsg1-11.10.7+dfsg1-21.10.7+dfsg1-2build1
1.10.7+dfsg1-2ubuntu0.1~esm2
ruby-nokogiri
Ubuntu:Pro:22.04:LTS
before 1.13.1+dfsg-2ubuntu0.1~esm1, plus listed versions
1.11.1+dfsg-2ubuntu11.11.7+dfsg-31.11.7+dfsg-3build11.13.1+dfsg-2
1.13.1+dfsg-2ubuntu0.1~esm1
rubygem-nokogiri
openSUSE:Tumbleweed
before 1.13.6-1.1
1.13.6-1.1
ruby3.2-rubygem-nokogiri
openSUSE:Tumbleweed
before 1.13.9-1.7
1.13.9-1.7
rubygem-nokogiri
openSUSE:Tumbleweed
before 1.15.5-1.5
1.15.5-1.5
rubygem-nokogiri
openSUSE:Tumbleweed
before 1.18.2-1.1
1.18.2-1.1
rubygem-nokogiri
openSUSE:Tumbleweed
before 1.18.9-1.4
1.18.9-1.4

History

History
RecordedChangedSources
affected, aliases, referencesOSV
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2022-29181 is a high vulnerability (CVSS 8.2) in Nokogiri, published May 20, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 3.23%, the 88th percentile. Fixed in nokogiri 1.13.6.

References

Show 194 moreShow less
This page doesn't list everything

Left out here: 95 versions and 191 references. The JSON record has them.

MoveEnter Open