|
| 1 | +--- |
| 2 | +gem: nokogiri |
| 3 | +ghsa: fq42-c5rg-92c2 |
| 4 | +url: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-fq42-c5rg-92c2 |
| 5 | +title: Vulnerable dependencies in Nokogiri |
| 6 | +date: 2022-02-25 |
| 7 | +description: | |
| 8 | + ### Summary |
| 9 | +
|
| 10 | + Nokogiri [v1.13.2](https://github.com/sparklemotion/nokogiri/releases/tag/v1.13.2) upgrades two of its packaged dependencies: |
| 11 | +
|
| 12 | + - vendored libxml2 from v2.9.12 to [v2.9.13](https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.13.news) |
| 13 | + - vendored libxslt from v1.1.34 to [v1.1.35](https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.35.news) |
| 14 | +
|
| 15 | + Those library versions address the following upstream CVEs: |
| 16 | +
|
| 17 | + - libxslt: [CVE-2021-30560](https://nvd.nist.gov/vuln/detail/CVE-2021-30560) (CVSS 8.8, High severity) |
| 18 | + - libxml2: [CVE-2022-23308](https://nvd.nist.gov/vuln/detail/CVE-2022-23308) (Unspecified severity, see more information below) |
| 19 | +
|
| 20 | + Those library versions also address numerous other issues including performance improvements, regression fixes, and bug fixes, as well as memory leaks and other use-after-free issues that were not assigned CVEs. |
| 21 | +
|
| 22 | + Please note that this advisory only applies to the CRuby implementation of Nokogiri `< 1.13.2`, and only if the _packaged_ libraries are being used. If you've overridden defaults at installation time to use _system_ libraries instead of packaged libraries, you should instead pay attention to your distro's `libxml2` and `libxslt` release announcements. |
| 23 | +
|
| 24 | +
|
| 25 | + ### Mitigation |
| 26 | +
|
| 27 | + Upgrade to Nokogiri `>= 1.13.2`. |
| 28 | +
|
| 29 | + Users who are unable to upgrade Nokogiri may also choose a more complicated mitigation: compile and link an older version Nokogiri against external libraries libxml2 `>= 2.9.13` and libxslt `>= 1.1.35`, which will also address these same CVEs. |
| 30 | +
|
| 31 | +
|
| 32 | + ### Impact |
| 33 | +
|
| 34 | + #### libxslt [CVE-2021-30560](https://nvd.nist.gov/vuln/detail/CVE-2021-30560) |
| 35 | +
|
| 36 | + - CVSS3 score: 8.8 (High) |
| 37 | + - Fixed by https://gitlab.gnome.org/GNOME/libxslt/-/commit/50f9c9c |
| 38 | +
|
| 39 | + All versions of libxslt prior to v1.1.35 are affected. |
| 40 | +
|
| 41 | + Applications using **untrusted** XSL stylesheets to transform XML are vulnerable to a denial-of-service attack and should be upgraded immediately. |
| 42 | +
|
| 43 | +
|
| 44 | + #### libxml2 [CVE-2022-23308](https://nvd.nist.gov/vuln/detail/CVE-2022-23308) |
| 45 | +
|
| 46 | + - As of the time this security advisory was published, there is no officially published information available about this CVE's severity. The above NIST link does not yet have a published record, and the libxml2 maintainer has declined to provide a severity score. |
| 47 | + - Fixed by https://gitlab.gnome.org/GNOME/libxml2/-/commit/652dd12 |
| 48 | + - Further explanation is at https://mail.gnome.org/archives/xml/2022-February/msg00015.html |
| 49 | +
|
| 50 | + The upstream commit and the explanation linked above indicate that an application may be vulnerable to a denial of service, memory disclosure, or code execution if it parses an **untrusted** document with parse options `DTDVALID` set to true, and `NOENT` set to false. |
| 51 | +
|
| 52 | + An analysis of these parse options: |
| 53 | +
|
| 54 | + - While `NOENT` is off by default for Document, DocumentFragment, Reader, and Schema parsing, it is on by default for XSLT (stylesheet) parsing in Nokogiri v1.12.0 and later. |
| 55 | + - `DTDVALID` is an option that Nokogiri does not set for any operations, and so this CVE applies only to applications setting this option explicitly. |
| 56 | +
|
| 57 | + It seems reasonable to assume that any application explicitly setting the parse option `DTDVALID` when parsing **untrusted** documents is vulnerable and should be upgraded immediately. |
| 58 | +cvss_v3: 8.8 |
| 59 | +patched_versions: |
| 60 | +- ">= 1.13.2" |
| 61 | +related: |
| 62 | + url: |
| 63 | + - https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-fq42-c5rg-92c2 |
| 64 | + - https://github.com/advisories/GHSA-fq42-c5rg-92c2 |
0 commit comments