# CVE-2022-49043: Use after free in libxml2

> A use-after-free vulnerability in libxml2 allows attackers to execute arbitrary code or cause a denial of service via crafted XML input.

- **Severity:** High 8.1 (`CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Jan 2025
- **Updated:** 3 Nov 2025
- **Also known as:** ALSA-2025:1350, ALSA-2025:1517, AZL-55967, CLSA-2025-1739961336, CLSA-2025-1742577756, CLSA-2025-1742578098, CLSA-2025-1742914538, CLSA-2025-1761139574, CLSA-2025-1761673925, CLSA-2026-1778491896, CLSA-2026-1778492595, CLSA-2026-1779215759, DEBIAN-CVE-2022-49043, ECHO-fd8a-6039-c2c3, GHSA-84p5-cqqq-h4gr, JLSEC-2025-85, MGASA-2025-0034, OESA-2025-1104, RHSA-2025:1350, RHSA-2025:1516, RHSA-2025:1517, RLSA-2025:1517, SUSE-SU-2025:0300-1, SUSE-SU-2025:0303-1, SUSE-SU-2025:0341-1, SUSE-SU-2025:0348-1, UBUNTU-CVE-2022-49043

## What is CVE-2022-49043?

CVE-2022-49043 is a high-severity use after free vulnerability in Xmlsoft Libxml2, published on 26 Jan 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

xmlXIncludeAddNode in xinclude.c in libxml2 before 2.11.0 has a use-after-free.

Weakness: CWE-416 (Use After Free)

## Which versions are affected by CVE-2022-49043?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libxml2` | AlmaLinux:8 | All versions | 2.9.7-18.el8_10.2 |
| `libxml2-devel` | AlmaLinux:8 | All versions | 2.9.7-18.el8_10.2 |
| `python3-libxml2` | AlmaLinux:8 | All versions | 2.9.7-18.el8_10.2 |
| `libxml2` | AlmaLinux:9 | All versions | 2.9.13-6.el9_5.1 |
| `libxml2-devel` | AlmaLinux:9 | All versions | 2.9.13-6.el9_5.1 |
| `python3-libxml2` | AlmaLinux:9 | All versions | 2.9.13-6.el9_5.1 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-18.el8_10.2 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-18.el8_10.2 |
| `libxml2-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-18.el8_10.2 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-18.el8_10.2 |
| `libxml2` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-18.el8_10.2 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-18.el8_10.2 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-18.el8_10.2 |
| `python3-libxml2` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-18.el8_10.2 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-18.el8_10.2 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-6.el9_5.1 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-6.el9_5.1 |
| `libxml2-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-6.el9_5.1 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-6.el9_5.1 |
| `libxml2` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-6.el9_5.1 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-6.el9_5.1 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-6.el9_5.1 |
| `python3-libxml2` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-6.el9_5.1 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-6.el9_5.1 |
| `libxml2-debuginfo` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:2.9.13-3.el9_2.4 |
| `libxml2-debugsource` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:2.9.13-3.el9_2.4 |
| `libxml2-devel` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:2.9.13-3.el9_2.4 |
| `python3-libxml2-debuginfo` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:2.9.13-3.el9_2.4 |
| `libxml2` | Red Hat:rhel_eus:9.2::baseos | All versions | 0:2.9.13-3.el9_2.4 |
| `libxml2-debuginfo` | Red Hat:rhel_eus:9.2::baseos | All versions | 0:2.9.13-3.el9_2.4 |
| `libxml2-debugsource` | Red Hat:rhel_eus:9.2::baseos | All versions | 0:2.9.13-3.el9_2.4 |
| `python3-libxml2` | Red Hat:rhel_eus:9.2::baseos | All versions | 0:2.9.13-3.el9_2.4 |
| `python3-libxml2-debuginfo` | Red Hat:rhel_eus:9.2::baseos | All versions | 0:2.9.13-3.el9_2.4 |
| `libxml2` | Rocky Linux:8 | All versions | 0:2.9.7-18.el8_10.2 |
| `libxml2` | SUSE:Enterprise Storage 7.1 | All versions | 2.9.7-150000.3.73.1 |
| `python-libxml2-python` | SUSE:Enterprise Storage 7.1 | All versions | 2.9.7-150000.3.73.1 |
| `libxml2` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 2.9.7-150000.3.73.1 |
| `python-libxml2-python` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 2.9.7-150000.3.73.1 |
| `libxml2` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2.9.14-150400.5.35.1 |
| `libxml2-python` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2.9.14-150400.5.35.1 |

Products: Xmlsoft Libxml2.

## How do I fix CVE-2022-49043?

Upgrade to a fixed version.

## Is CVE-2022-49043 being exploited?

There is no known exploitation of CVE-2022-49043 in the wild and no public exploit code.

## Other vulnerabilities in Xmlsoft Libxml2

- [CVE-2017-16931](https://insights.sbomify.com/CVE-2017-16931/): XML external entity in n/a (critical 9.8)
- [CVE-2017-8872](https://insights.sbomify.com/CVE-2017-8872/): Information disclosure in n/a (critical 9.1)
- [CVE-2026-86140](https://insights.sbomify.com/CVE-2026-86140/): Memory corruption in libxml2 (high 8.0)
- [CVE-2024-34459](https://insights.sbomify.com/CVE-2024-34459/): Memory corruption in n/a (high 7.5)
- [CVE-2024-25062](https://insights.sbomify.com/CVE-2024-25062/): Use after free in n/a (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-49043 and fix it if it is affected.

What it is: CVE-2022-49043 is a high-severity use after free vulnerability in Xmlsoft Libxml2, published on 26 Jan 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-49043 in the wild and no public exploit code.

Affected product: Xmlsoft Libxml2. No package-level version data is available, so check the vendor advisory linked from the reference page.

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/CVE-2022-49043/ (Markdown: https://insights.sbomify.com/CVE-2022-49043/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-49043
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-49043
- OSV: https://osv.dev/vulnerability/CVE-2022-49043

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-49043/
Summaries are generated and may contain mistakes; the official description above is the record.
