# GHSA-vvfq-8hwr-qm4m: Nokogiri updates packaged libxml2 to 2.13.6 to resolve CVE-2025-24928 and CVE-2024-56171


- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 18 Feb 2025

## What is GHSA-vvfq-8hwr-qm4m?

GHSA-vvfq-8hwr-qm4m is a vulnerability in nokogiri, published on 18 Feb 2025. 

### Official description

## Summary

Nokogiri v1.18.3 upgrades its dependency libxml2 to [v2.13.6](https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.13.6).

libxml2 v2.13.6 addresses:

- CVE-2025-24928
  - described at https://gitlab.gnome.org/GNOME/libxml2/-/issues/847
- CVE-2024-56171
   - described at https://gitlab.gnome.org/GNOME/libxml2/-/issues/828

## Impact

### CVE-2025-24928

Stack-buffer overflow is possible when reporting DTD validation errors if the input contains a long (~3kb) QName prefix.

### CVE-2024-56171

Use-after-free is possible during validation against untrusted XML Schemas (.xsd) and, potentially, validation of untrusted documents against trusted Schemas if they make use of `xsd:keyref` in combination with recursively defined types that have additional identity constraints.

## Which versions are affected by GHSA-vvfq-8hwr-qm4m?

1 open source package ship an affected version, including nokogiri.


| Package | Ecosystem | PURL | Affected | Fixed in |
| --- | --- | --- | --- | --- |
| `nokogiri` | RubyGems | `pkg:gem/nokogiri` | All versions | 1.18.3 |

Status by vendor (upstream, then each distribution release and vendor build):

| Who | Release | Status | Packages | Fixed in |
| --- | --- | --- | --- | --- |
| Upstream |  | fixed | `nokogiri` | 1.18.3 |

## How do I fix GHSA-vvfq-8hwr-qm4m?

Upgrade nokogiri to 1.18.3 or later.

## Is GHSA-vvfq-8hwr-qm4m being exploited?

There is no known exploitation of GHSA-vvfq-8hwr-qm4m in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-vvfq-8hwr-qm4m and fix it if it is affected.

What it is: GHSA-vvfq-8hwr-qm4m is a vulnerability in nokogiri, published on 18 Feb 2025. 
Exploitation: There is no known exploitation of GHSA-vvfq-8hwr-qm4m in the wild and no public exploit code.

Affected packages and fixed versions:
- nokogiri (RubyGems): affected all versions; fixed in 1.18.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-vvfq-8hwr-qm4m/ (Markdown: https://insights.sbomify.com/GHSA-vvfq-8hwr-qm4m/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-vvfq-8hwr-qm4m

---
From sbomify Insights: https://insights.sbomify.com/GHSA-vvfq-8hwr-qm4m/
Summaries are generated and may contain mistakes; the official description above is the record.
