Executive brief
Nokogiri is a popular Ruby library used for parsing and processing XML and HTML documents. A security flaw in its underlying processing engine could allow an attacker to read small amounts of sensitive information from the server's memory by providing specially crafted formatting strings. This could potentially lead to the exposure of internal data or help an attacker bypass other security measures.
Technical details
An uninitialized read vulnerability exists in libxslt (specifically in numbers.c) when processing xsl:number instructions with certain format strings. The root cause is located in the xsltNumberFormatInsertNumbers function, where a failure to initialize resources allows an attacker to infer the contents of bytes on the stack (such as identifying specific characters like 'A', 'a', 'I', 'i', or '0'). This is a network-reachable vulnerability requiring no authentication or user interaction. While the information leak is limited in scope per request, it can be used to bypass memory protections or leak sensitive stack data. The issue is addressed in Nokogiri version 1.10.5 by updating the bundled libxslt dependency.
Affected products
- Nokogiri Nokogiri < 1.10.5
- GNOME libxslt 1.1.33
Timeline
- 2019-07-01: disclosed: NVD publication date
- 2019-10-22: patched: Nokogiri v1.10.5 released with fix
- 2022-05-24: advisory: GitHub Advisory published
References
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14471
- https://gitlab.gnome.org/GNOME/libxslt/commit/c5eb6cf3aba0af048596106ed839b4ae17ecbcb1
- https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b@%3Cissues.bookkeeper.apache.org%3E
- https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4@%3Cissues.bookkeeper.apache.org%3E
- https://lists.debian.org/debian-lts-announce/2019/07/msg00020.html