|
| 1 | +--- |
| 2 | +gem: nokogiri |
| 3 | +ghsa: 2qc6-mcvw-92cw |
| 4 | +url: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-2qc6-mcvw-92cw |
| 5 | +title: Update bundled libxml2 to v2.10.3 to resolve multiple CVEs |
| 6 | +date: 2022-10-18 |
| 7 | +description: | |
| 8 | + ### Summary |
| 9 | +
|
| 10 | + Nokogiri v1.13.9 upgrades the packaged version of its dependency libxml2 to |
| 11 | + [v2.10.3](https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.10.3) from |
| 12 | + v2.9.14. |
| 13 | +
|
| 14 | + libxml2 v2.10.3 addresses the following known vulnerabilities: |
| 15 | +
|
| 16 | + - [CVE-2022-2309](https://nvd.nist.gov/vuln/detail/CVE-2022-2309) |
| 17 | + - [CVE-2022-40304](https://nvd.nist.gov/vuln/detail/CVE-2022-40304) |
| 18 | + - [CVE-2022-40303](https://nvd.nist.gov/vuln/detail/CVE-2022-40303) |
| 19 | +
|
| 20 | + Please note that this advisory only applies to the CRuby implementation of |
| 21 | + Nokogiri `< 1.13.9`, and only if the _packaged_ libraries are being used. If |
| 22 | + you've overridden defaults at installation time to use _system_ libraries |
| 23 | + instead of packaged libraries, you should instead pay attention to your |
| 24 | + distro's `libxml2` release announcements. |
| 25 | +
|
| 26 | +
|
| 27 | + ### Mitigation |
| 28 | +
|
| 29 | + Upgrade to Nokogiri `>= 1.13.9`. |
| 30 | +
|
| 31 | + Users who are unable to upgrade Nokogiri may also choose a more complicated |
| 32 | + mitigation: compile and link Nokogiri against external libraries libxml2 |
| 33 | + `>= 2.10.3` which will also address these same issues. |
| 34 | +
|
| 35 | +
|
| 36 | + ### Impact |
| 37 | +
|
| 38 | + #### libxml2 [CVE-2022-2309](https://nvd.nist.gov/vuln/detail/CVE-2022-2309) |
| 39 | +
|
| 40 | + - **CVSS3 score**: Under evaluation |
| 41 | + - **Type**: Denial of service |
| 42 | + - **Description**: NULL Pointer Dereference allows attackers to cause a denial |
| 43 | + of service (or application crash). This only applies when lxml is used |
| 44 | + together with libxml2 2.9.10 through 2.9.14. libxml2 2.9.9 and earlier are not |
| 45 | + affected. It allows triggering crashes through forged input data, given a |
| 46 | + vulnerable code sequence in the application. The vulnerability is caused by |
| 47 | + the iterwalk function (also used by the canonicalize function). Such code |
| 48 | + shouldn't be in wide-spread use, given that parsing + iterwalk would usually |
| 49 | + be replaced with the more efficient iterparse function. However, an XML |
| 50 | + converter that serialises to C14N would also be vulnerable, for example, and |
| 51 | + there are legitimate use cases for this code sequence. If untrusted input is |
| 52 | + received (also remotely) and processed via iterwalk function, a crash can be |
| 53 | + triggered. |
| 54 | +
|
| 55 | + Nokogiri maintainers investigated at #2620 and determined this CVE does not |
| 56 | + affect Nokogiri users. |
| 57 | +
|
| 58 | +
|
| 59 | + #### libxml2 [CVE-2022-40304](https://nvd.nist.gov/vuln/detail/CVE-2022-40304) |
| 60 | +
|
| 61 | + - **CVSS3 score**: Unspecified upstream |
| 62 | + - **Type**: Data corruption, denial of service |
| 63 | + - **Description**: When an entity reference cycle is detected, the entity |
| 64 | + content is cleared by setting its first byte to zero. But the entity content |
| 65 | + might be allocated from a dict. In this case, the dict entry becomes corrupted |
| 66 | + leading to all kinds of logic errors, including memory errors like |
| 67 | + double-frees. |
| 68 | +
|
| 69 | + See https://gitlab.gnome.org/GNOME/libxml2/-/commit/644a89e080bced793295f61f18aac8cfad6bece2 |
| 70 | +
|
| 71 | +
|
| 72 | + #### libxml2 [CVE-2022-40303](https://nvd.nist.gov/vuln/detail/CVE-2022-40303) |
| 73 | +
|
| 74 | + - **CVSS3 score**: Unspecified upstream |
| 75 | + - **Type**: Integer overflow |
| 76 | + - **Description**: Integer overflows with XML_PARSE_HUGE |
| 77 | +
|
| 78 | + See https://gitlab.gnome.org/GNOME/libxml2/-/commit/c846986356fc149915a74972bf198abc266bc2c0 |
| 79 | +patched_versions: |
| 80 | +- ">= 1.13.19" |
| 81 | +related: |
| 82 | + url: |
| 83 | + - https://gitlab.gnome.org/GNOME/libxml2/-/releases |
| 84 | + cve: |
| 85 | + - 2022-2309 |
| 86 | + - 2022-40304 |
| 87 | + - 2022-40303 |
0 commit comments