CVE-2023-51791
High · 7.8CVSS
7.8
EPSS
0.3%
Published
Apr 19, 2024
CISA due date
—
Cloudanix analysis
A bug in widely used media software lets someone who can already run programs on the computer take full control by feeding it a specially made video or image file.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Library
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Local buffer overflow in the gen_alias_map function of libavcodec/jpegxl_parser.c allows an attacker to overwrite memory and execute arbitrary code when parsing specially crafted JPEG XL data.
Why it matters to the business
Systems that process untrusted media files with FFmpeg can be fully compromised by a local user, leading to unauthorized code execution, data theft, or persistence on the affected host.
How an attack unfolds
A local attacker supplies a malformed JPEG XL stream that reaches the vulnerable alias map generation routine; the overflow corrupts adjacent stack or heap structures, allowing the attacker to redirect control flow and execute attacker-supplied code within the FFmpeg process context.
How to fix it
Upgrade FFmpeg to a version that contains the corrected jpegxl_parser implementation; until then, avoid processing untrusted JPEG XL content and run FFmpeg under the lowest possible privileges.
How to confirm the fix worked
Confirm the installed FFmpeg build no longer contains the vulnerable gen_alias_map routine by inspecting source or binary symbols, and test with known-triggering JPEG XL samples in a controlled environment.
Typical attack path
- Obtain local access or ability to supply media input to an FFmpeg-based application
- Craft a JPEG XL file or stream that triggers the buffer overflow in gen_alias_map
- Cause the target application to parse the malicious input
- Leverage the resulting memory corruption to achieve arbitrary code execution
How to detect it
Review application and system logs for segmentation faults or abnormal terminations in FFmpeg processes that handle JPEG XL content; correlate with file creation or access events involving suspicious media files.
What your security team should do
- Prioritize patching FFmpeg across all media-processing pipelines
- Restrict which users and services can invoke FFmpeg on untrusted input
- Enable address space layout randomization and other memory protections on hosts running FFmpeg
- Monitor for unexpected crashes or high-severity alerts in media-handling services
The record
Buffer Overflow vulenrability in Ffmpeg v.N113007-g8d24a28d06 allows a local attacker to execute arbitrary code via the libavcodec/jpegxl_parser.c in gen_alias_map.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Chainguard | ffmpeg-6 | 0 | 0 |
| Chainguard | ffmpeg-6-dev | 0 | 0 |
| Chainguard | ffmpeg-6-doc | 0 | 0 |
| Chainguard | ffmpeg-6-libavcodec61 | 0 | 0 |
| Chainguard | ffmpeg-6-libavdevice61 | 0 | 0 |
| Chainguard | ffmpeg-6-libavfilter10 | 0 | 0 |
| Chainguard | ffmpeg-6-libavformat61 | 0 | 0 |
| Chainguard | ffmpeg-6-libavutil59 | 0 | 0 |
| Chainguard | ffmpeg-6-libpostproc58 | 0 | 0 |
| Chainguard | ffmpeg-6-libswresample5 | 0 | 0 |
| Chainguard | ffmpeg-6-libswscale8 | 0 | 0 |
| Chainguard | ffmpeg-6-qt-faststart | 0 | 0 |
| Chainguard | ffmpeg-6-static | 0 | 0 |
| Chainguard | ffmpeg-7 | 0 | 7.1.3-r2 |
| Chainguard | ffmpeg-7.1 | 0 | 7.1.3-r1 |
| Chainguard | ffmpeg-8.0 | 0 | 8.0.1-r2 |
| Debian:13 | ffmpeg | 0 | 7:7.0.1-3 |
| Ubuntu:24.10 | ffmpeg | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | libav | 0 | No fix |
| Wolfi | ffmpeg-7 | 0 | 7.1.3-r2 |
| Wolfi | ffmpeg-7.1 | 0 | 7.1.3-r1 |
| Wolfi | ffmpeg-8.0 | 0 | 8.0.1-r2 |
Related vulnerabilities
- CVE-2025-0518 Unchecked Return Value, Out-of-bounds Read vulnerability in FFmpeg allows Read Sensitive… Also affects ffmpeg-6
- CVE-2023-51794 Buffer Overflow vulnerability in Ffmpeg v.N113007-g8d24a28d06 allows a local attacker to… Also affects ffmpeg-6
- CVE-2023-51793 Buffer Overflow vulnerability in Ffmpeg v.N113007-g8d24a28d06 allows a local attacker to… Also affects ffmpeg-6
- CVE-2023-51796 Buffer Overflow vulnerability in Ffmpeg v.N113007-g8d24a28d06 allows a local attacker to… Also affects ffmpeg-6
- CVE-2023-51798 Buffer Overflow vulnerability in Ffmpeg v.N113007-g8d24a28d06 allows a local attacker to… Also affects ffmpeg-6
- CVE-2023-51795 Buffer Overflow vulnerability in Ffmpeg v.N113007-g8d24a28d06 allows a local attacker to… Also affects ffmpeg-6
- CVE-2023-50010 Buffer Overflow vulnerability in Ffmpeg v.n6.1-3-g466799d4f5 allows a local attacker to… Also affects ffmpeg-6
- CVE-2023-50009 Buffer Overflow vulnerability in Ffmpeg v.n6.1-3-g466799d4f5 allows a local attacker to… Also affects ffmpeg-6