Skip to content

GHSA-g9xm-7538-mq8w CVE-2024-24826 PYSEC-2024-106

Exiv2 has an out-of-bounds read in QuickTimeVideo::NikonTagsDecoder

Medium PyPI
Severity
5.5 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.24%
Chance of exploitation in the next 30 days. Higher than 14.96% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-125 Out-of-bounds Read
Fix
0.16.1
Upgrade exiv2 to this version or later

Description

Impact

An out-of-bounds read was found in Exiv2 version v0.28.1. The vulnerable function, QuickTimeVideo::NikonTagsDecoder, was new in v0.28.0 (see https://github.com/Exiv2/exiv2/pull/2337), so Exiv2 versions before v0.28 are not affected. Exiv2 is a command-line utility and C++ library for reading, writing, deleting, and modifying the metadata of image files. The out-of-bounds read is triggered when Exiv2 is used to read the metadata of a crafted video file.

Patches

The bug is fixed in version v0.28.2.

For more information

Please see our security policy for information about Exiv2 security.

Credit

This bug was found by OSS-Fuzz.

Affected versions

PyPI

PackageVulnerableFixed in
exiv2
>= 0.16.0, < 0.16.1
0.16.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

exiv2 PyPI → 0.16.1

pip
pip install --upgrade "exiv2>=0.16.1"
poetry
poetry add "exiv2>=0.16.1"
uv
uv add "exiv2>=0.16.1"

Severity breakdown

CVSS 3.1 5.5

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

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Weakness

CWE-125: Out-of-bounds Read

The product reads data past the end, or before the beginning, of the intended buffer.

How to prevent it
  • Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright. To reduce the likelihood of introducing an out-of-bounds read, ensure that you validate and ensure correct calculations for any length argument, buffer size calculation, or offset. Be especially careful of relying on a sentinel (i.e. special character such as NUL) in untrusted inputs.
  • Architecture and Design: Use a language that provides appropriate memory abstractions.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-m54q-mm9w-fp6g
Exiv2 has quadratic performance in ICC profile parsing in JpegBase::readMetadata
Medium Also affects exiv2
GHSA-496f-x7cq-cq39
Exiv2 Segmentation Faults in Exiv2::EpsImage::writeMetadata() via crafted EPS file
Medium Also affects exiv2
GHSA-38h4-fx85-qcx7
Exiv2 allows Use After Free
Critical Also affects exiv2
GHSA-crmj-qh74-2r36
Exiv2 has a denial of service due to unbounded recursion in QuickTimeVideo::multipleEntriesDecoder
Medium Also affects exiv2
PYSEC-2023-233
Exiv2 is a C++ library and a command-line utility to read, write, delete and modify Exif, IPTC, XMP and ICC image metadata.
High Also affects exiv2
PYSEC-2023-150
Buffer Overflow vulnerability in tEXtToDataBuf function in pngimage.cpp in Exiv2 0.27.1 allows remote attackers to cause a denial of service and other…
High Also affects exiv2
PYSEC-2021-879
An uncontrolled memory allocation in DataBufdata(subBox.length-sizeof(box)) function of Exiv2 0.27 allows attackers to cause a denial of service (DOS) via a…
Medium Also affects exiv2
PYSEC-2021-877
An integer overflow in CrwMap::encode0x1810 of Exiv2 0.27.3 allows attackers to trigger a heap-based buffer overflow and cause a denial of service (DOS) via…
High Also affects exiv2
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor