Executive brief
Nokogiri, a popular Ruby library for processing XML and HTML, is vulnerable to a security bypass due to a flaw in its underlying libxslt component. An attacker can use specially crafted web addresses (URLs) to bypass security checks that normally restrict file access. This could allow an unauthorized user to read or write sensitive files on the system, potentially leading to a full system compromise or data theft.
Technical details
A vulnerability exists in libxslt (through version 1.1.33), a dependency of the Nokogiri Ruby gem, where the security functions `xsltCheckRead` and `xsltCheckWrite` fail to properly handle error codes. Specifically, these routines permit access when they receive a -1 error code. An attacker can provide a specially crafted URL that triggers this -1 return value without being flagged as invalid, effectively bypassing the library's security sandbox. This allows for arbitrary file read or write operations depending on the context of the library's use. The issue is resolved in Nokogiri version 1.10.3 by updating the bundled libxslt or applying relevant patches.
Affected products
- Nokogiri Nokogiri < 1.10.3
- GNOME libxslt <= 1.1.33
Timeline
- 2019-04-10: disclosed: Initial NVD publication
- 2019-04-15: advisory: Debian security advisory released
- 2022-05-13: advisory: GitHub Advisory Database entry published
References
- https://gitlab.gnome.org/GNOME/libxslt/commit/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6
- https://lists.debian.org/debian-lts-announce/2019/04/msg00016.html
- https://www.oracle.com/technetwork/security-advisory/cpuoct2019-5072832.html
- http://lists.opensuse.org/opensuse-security-announce/2019-05/msg00048.html
- http://lists.opensuse.org/opensuse-security-announce/2019-05/msg00052.html