---
title: "GHSA-78h3-pg4x-j8cv: libxmljs2 vulnerable to type confusion when parsing specially crafted XML"
description: "Critical severity. libxmljs2 vulnerable to type confusion when parsing specially crafted XML. Affects libxmljs2; fixed in 0.37.0."
url: https://inlinr.com/advisories/GHSA-78h3-pg4x-j8cv
lang: en
---

[Packages](https://inlinr.com/packages) / [libxmljs2](https://inlinr.com/packages/libxmljs2) / [Security](https://inlinr.com/packages/libxmljs2/security)

Critical Vulnerability GHSA-78h3-pg4x-j8cv CVE-2024-34394 Published 2 May 2024

# libxmljs2 vulnerable to type confusion when parsing specially crafted XML

Your version 

Affected releases · [libxmljs2](https://inlinr.com/packages/libxmljs2)

- 0.35.x and older 0.20.0 – 0.35.0 No fix, no longer updated

0.35.x has no fix yet; the newest fixed line:

```
npm install libxmljs2@0.37.0
```

Every release on a timeline

1. Affected

0.20.0 – 0.35.0  
38 releases
2. Fixed

0.37.0  
1 release, latest

39 stable releases of libxmljs2, oldest to newest.

## What happens

libxmljs2 is vulnerable to a type confusion vulnerability when parsing a specially crafted XML while invoking the `namespaces()` function (which invokes `XmlNode::get_local_namespaces()`) on a grand-child of a node that refers to an entity. This vulnerability can lead to denial of service and remote code execution.

## How it is exploited

Exploitable over the network, with no account and no action from a user.

- **Confidentiality**: high
- **Integrity**: high
- **Availability**: high

CVSS:3.1/​AV:N/​AC:H/​PR:N/​UI:N/​S:U/​C:H/​I:H/​A:H

## References

- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2024-34394 "https://nvd.nist.gov/vuln/detail/CVE-2024-34394")  
nvd.nist.gov/vuln/detail/CVE-2024-34394
- [Issue](https://github.com/marudor/libxmljs2/issues/205 "https://github.com/marudor/libxmljs2/issues/205")  
#205
- [Package](https://github.com/marudor/libxmljs2 "https://github.com/marudor/libxmljs2")  
github.com/marudor/libxmljs2
- [Reference](https://research.jfrog.com/vulnerabilities/libxmljs2-namespaces-type-confusion-rce-jfsa-2024-001034098 "https://research.jfrog.com/vulnerabilities/libxmljs2-namespaces-type-confusion-rce-jfsa-2024-001034098")  
research.jfrog.com/vulnerabilities/libxmljs2-na…

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
