NULL Pointer Dereference Vulnerability in Expat Package (CVE-2026-32778)

expat Updated 18 Mar 2026

Summary

16/03/2026
N/A
Yes i
Medium
5.5

ALPINE-CVE-2026-32778: libexpat before 2.7.5 allows a NULL pointer dereference in the function setContext on retry after an earlier ouf-of-memory condition. Affects expat versions < 2.7.5-r0. Fixed in 2.7.5-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Expat is an XML parsing library that is widely used in various software applications for its efficiency and ease of use. It provides a simple API for parsing XML documents and is known for its performance and reliability. However, prior to version 2.7.5, Expat is susceptible to a NULL pointer dereference vulnerability that can occur during error handling, particularly after an out-of-memory condition.

Vulnerability Detail

The vulnerability identified as CVE-2026-32778 allows for a NULL pointer dereference in the function setContext when the library attempts to retry after encountering an out-of-memory condition. This flaw can lead to application crashes or unexpected behavior, potentially exposing systems to denial-of-service attacks. The issue arises from improper handling of memory allocation failures, which can leave the application in an unstable state.

How To Fix

Minimum fixed version

2.7.5-r0

This is the first release that contains the fix.

sudo apk add --upgrade expat

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you may consider implementing additional error handling in your application to manage memory allocation failures more gracefully. However, the best approach is to update to the patched version of the Expat library.

Conclusion

The CVE-2026-32778 vulnerability in the Expat package poses a risk of NULL pointer dereference, which can lead to application instability. It is crucial to update to version 2.7.5 or later to mitigate this risk. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for expat →

Share this vulnerability

FAQ

CVE-2026-32778 is a vulnerability in the Expat XML parsing library that allows for a NULL pointer dereference, potentially leading to application crashes.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Expat versions prior to 2.7.5 are affected by this vulnerability.

The CVSS score for CVE-2026-32778 is 5.5, indicating a moderate severity level.

If immediate updates are not possible, consider implementing additional error handling to manage memory allocation failures until you can upgrade.

Related vulnerabilities

Recent vulnerabilities recorded for expat.

How To Fix

Minimum fixed version

2.7.5-r0

This is the first release that contains the fix.

sudo apk add --upgrade expat

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback