nokogiri: Access of Resource Using Incompatible Type
CVE-2022-29181 is a high-severity access of resource using incompatible type vulnerability in nokogiri from Sparklemotion, with a CVSS 3.1 base score of 8.2 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected nokogiri versions: < 1.13.6. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 3.23% chance of exploitation within 30 days, higher than 88% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update macOS to 13.1 or a later version.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Sparklemotion | nokogiri | < 1.13.6 | Not stated |
| Apple | macOS | 13.0 up to, but not including, 13.1 | 13.1 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- LowSome restricted data can be read.
- Integrity
- NoneNothing can be modified.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 8.2 | High | CNA (github.com) |
| CVSS 3.1 | 8.2 | High | NVD |
| CVSS 2.0 | 6.4 | Medium | NVD |
Official description
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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Access of Resource Using Incompatible Type
The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.
More Access of Resource Using Incompatible Type vulnerabilities (CWE-843)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: yes, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Advisories
- github.com/sparklemotion/nokogiri/security/advisories/GHSA-xh29-r2w5-wx8mIssue Tracking, Third Party Advisory
Patches and release notes
- github.com/sparklemotion/nokogiri/commit/83cc451c3f29df397caa890afc3b714eae6ab8f7
- github.com/sparklemotion/nokogiri/commit/db05ba9a1bd4b90aa6c76742cf6102a7c7297267Third Party Advisory
- github.com/sparklemotion/nokogiri/releases/tag/v1.13.6Release Notes, Third Party Advisory
Third-party and government advisories
- seclists.org/fulldisclosure/2022/Dec/23Mailing List, Third Party Advisory
- security.gentoo.org/glsa/202208-29Third Party Advisory
- support.apple.com/kb/HT213532Third Party Advisory
Technical write-ups (may include proof of concept)
- securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri/Exploit, Third Party Advisory
Other vulnerabilities in nokogiri
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 8.2 High severity
- 8.2 High severity
- 7.5 High severity
Recent Access of Resource Using Incompatible Type vulnerabilities
- 7.5 High severity
- 8.8 High severity
- 7.8 High severity
- 7.8 High severity
- 8.8 High severity
Google Chromium V8 Type Confusion Exploited
- 8.8 High severity
Google Chromium V8 Type Confusion Exploited
Spotted an error? Tell us.