CVE-2024-5171 in libaominfo

Summary

by MITRE • 06/05/2024

Integer overflow in libaom internal function img_alloc_helper can lead to heap buffer overflow. This function can be reached via 3 callers:


* Calling aom_img_alloc() with a large value of the d_w, d_h, or align parameter may result in integer overflows in the calculations of buffer sizes and offsets and some fields of the returned aom_image_t struct may be invalid. * Calling aom_img_wrap() with a large value of the d_w, d_h, or align parameter may result in integer overflows in the calculations of buffer sizes and offsets and some fields of the returned aom_image_t struct may be invalid. * Calling aom_img_alloc_with_border() with a large value of the d_w, d_h, align, size_align, or border parameter may result in integer overflows in the calculations of buffer sizes and offsets and some fields of the returned aom_image_t struct may be invalid.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 07/26/2025

The vulnerability described in CVE-2024-5171 represents a critical integer overflow condition within the libaom library that can escalate to heap buffer overflow conditions. This issue stems from the img_alloc_helper internal function which processes image allocation requests for the Alliance for Open Media's AV1 codec implementation. The vulnerability manifests when applications invoke the aom_img_alloc(), aom_img_wrap(), or aom_img_alloc_with_border() functions with excessively large dimension parameters. These functions internally call img_alloc_helper which performs arithmetic operations on the d_w, d_h, or align parameters without proper overflow validation, creating opportunities for attackers to manipulate buffer size calculations and subsequently corrupt heap memory structures.

The technical flaw operates through integer overflow mechanisms that occur during the computation of buffer sizes and memory offsets within the image allocation process. When large values are passed to the dimension parameters, the arithmetic operations involved in calculating required buffer space can exceed the maximum representable value for the integer type being used, causing the calculation to wrap around to a much smaller value. This overflow results in insufficient memory allocation, which then leads to heap buffer overflows when the application attempts to write beyond the allocated memory boundaries. The returned aom_image_t structure contains invalid field values that can cause further memory corruption during subsequent operations, making this vulnerability particularly dangerous as it affects core memory management functions.

The operational impact of this vulnerability extends across any application that utilizes the libaom library for video processing, including media players, streaming services, content creation tools, and video encoding software. Attackers can exploit this vulnerability by crafting specially formatted video files or media streams that trigger the overflow conditions during image allocation. The heap buffer overflow can potentially lead to arbitrary code execution, denial of service, or information disclosure depending on the specific memory corruption patterns. Given that libaom is widely used in both open source and commercial applications, the attack surface is extensive and includes web browsers, media frameworks, and multimedia applications that process user-supplied video content.

The vulnerability aligns with CWE-190, Integer Overflow or Wraparound, and presents characteristics consistent with ATT&CK technique T1203, Exploitation for Client Execution, as it enables remote code execution through malicious media files. The affected functions demonstrate poor input validation practices where parameter bounds are not properly checked before arithmetic operations. Organizations should implement immediate mitigations including parameter validation, input sanitization, and library updates from the vendor. The recommended approach involves applying patches that introduce proper integer overflow checks before buffer size calculations, implementing robust error handling for allocation failures, and conducting thorough security reviews of all image processing functions. Additionally, deployment of runtime protections such as address space layout randomization and stack canaries can provide additional defense in depth measures against exploitation attempts.

This vulnerability exemplifies the critical importance of input validation in multimedia processing libraries where integer arithmetic operations are common and buffer management is complex. The impact is particularly severe in environments where applications process untrusted media content, as the overflow conditions can be triggered through normal user interaction with media files, making this a significant risk to end-user security and system integrity.

Reservation

05/21/2024

Disclosure

06/05/2024

Moderation

accepted

CPE

ready

EPSS

0.01254

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!