CVE-2025-26623: Exiv2 Exiv2 Allows Use After Free Vulnerability
MODERATECVE-2025-26623 is a MODERATE exiv2 allows use after free vulnerability (CWE-416: Use After Free) affecting Exiv2 libraries in the PyPI ecosystem. The issue involves exiv2 allows use after free. Remediation is available by upgrading affected packages to version 0.28.5.
CVE-2025-26623 at a Glance
How to Fix CVE-2025-26623
To remediate this vulnerability, upgrade all affected Exiv2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install Exiv2>=0.28.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show Exiv2
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-26623, inspect your installed packages using pip:
pip show Exiv2
Analyze the terminal output to locate any version of Exiv2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.28.5), your application is affected.
Note: The pip show Exiv2 command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-416: Use After Free, where the product reuses or references memory after it has been freed. at some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. In Exiv2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-26623 Affected Exiv2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Exiv2
|
PyPI |
≥ 0.28.0
< 0.28.5
|
0.28.5
|
References
Frequently Asked Questions
What is CVE-2025-26623?
Which Exiv2 versions are affected?
What version fixes CVE-2025-26623?
Is Exiv2 affected?
What CWE is associated with CVE-2025-26623?
How can I check PyPI dependencies for CVE-2025-26623?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-38h4-fx85-qcx7",
"modified" : "2025-02-21T23:53:03Z",
"published" : "2025-02-21T23:53:03Z",
"aliases" : [ "CVE-2025-26623" ],
"summary" : "Exiv2 allows Use After Free",
"details" : "### Impact\nA heap buffer overflow was found in Exiv2 versions v0.28.0 to v0.28.4. Versions prior to v0.28.0, such as v0.27.7, are **not** affected. Exiv2 is a command-line utility and C++ library for reading, writing, deleting, and modifying the metadata of image files. The heap overflow is triggered when Exiv2 is used to write metadata into a crafted image file. An attacker could potentially exploit the vulnerability to gain code execution, if they can trick the victim into running Exiv2 on a crafted image file.\n\nNote that this bug is only triggered when writing the metadata, which is a less frequently used Exiv2 operation than reading the metadata. For example, to trigger the bug in the Exiv2 command-line application, you need to add an extra command-line argument such as `fixiso`.\n\n### Patches\nThe bug is fixed in version v0.28.5.\n\n### References\nIssue: https://github.com/Exiv2/exiv2/issues/3168\nFix: https://github.com/Exiv2/exiv2/pull/3174\n\n### For more information\nPlease see our [security policy](https://github.com/Exiv2/exiv2/security/policy) for information about Exiv2 security.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Exiv2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.28.0"
}, {
"fixed" : "0.28.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Exiv2/exiv2/security/advisories/GHSA-38h4-fx85-qcx7"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-26623"
}, {
"type" : "WEB",
"url" : "https://github.com/Exiv2/exiv2/issues/3168"
}, {
"type" : "WEB",
"url" : "https://github.com/Exiv2/exiv2/pull/3174"
}, {
"type" : "WEB",
"url" : "https://github.com/jim-easterbrook/python-exiv2/commit/4cc875e392f9e0bc705fe03d929b9a382b78dae4"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Exiv2/exiv2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-416" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-02-21T23:53:03Z",
"nvd_published_at" : "2025-02-18T20:15:33Z"
}
}