CVE-2025-26623: Exiv2 Exiv2 Allows Use After Free Vulnerability

MODERATE
Advisory Identifier: GHSA-38h4-fx85-qcx7
CWE-416
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2025-26623
GHSA Identifier GHSA-38h4-fx85-qcx7
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-416: Use After Free
Affected Product Exiv2
Package Ecosystem PyPI
Published Date
Last Updated

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.

Exiv2 fixed: 0.28.5
pip install Exiv2>=0.28.5
Verify Direct and Transitive Dependencies

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

### Impact A 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. Note 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`. ### Patches The bug is fixed in version v0.28.5. ### References Issue: https://github.com/Exiv2/exiv2/issues/3168 Fix: https://github.com/Exiv2/exiv2/pull/3174 ### For more information Please see our [security policy](https://github.com/Exiv2/exiv2/security/policy) for information about Exiv2 security.

CVE-2025-26623 Affected Exiv2 Versions

1 component(s)
Fixed Versions:
0.28.5
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?
CVE-2025-26623 is a security vulnerability in Exiv2 involving Exiv2 allows Use After Free under CWE-416: Use After Free.
Which Exiv2 versions are affected?
Affected versions include releases prior to 0.28.5 across affected packages: Exiv2.
What version fixes CVE-2025-26623?
Upgrading to 0.28.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Exiv2 affected?
Yes, Exiv2 is affected in releases prior to 0.28.5. Upgrade your dependency to 0.28.5 or later.
What CWE is associated with CVE-2025-26623?
CVE-2025-26623 is classified under CWE-416: Use After Free (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.).
How can I check PyPI dependencies for CVE-2025-26623?
Run the dependency tree command: 'pip show Exiv2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}