Bug 2382340 - CVE-2025-53816 7zip: 7-Zip heap buffer overflow
Summary: CVE-2025-53816 7zip: 7-Zip heap buffer overflow
Keywords:
Status: NEW
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: p7zip
Version: epel8
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Davide Cavalca
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-07-21 14:05 UTC by Dave B
Modified: 2025-07-21 14:05 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dave B 2025-07-21 14:05:06 UTC
Description of problem:

A critical memory corruption vulnerability in the popular file archiver 7-Zip has been discovered that allows attackers to trigger denial of service conditions by crafting malicious RAR5 archive files.

The vulnerability, tracked as CVE-2025-53816 and designated GHSL-2025-058, affects all versions of 7-Zip prior to version 25.00.

While the flaw is unlikely to lead to arbitrary code execution, it poses significant risks for denial-of-service attacks against systems processing untrusted archive files.

The vulnerability stems from a heap-based buffer overflow in 7-Zip’s RAR5 decoder implementation. Specifically, the flaw occurs in the NCompress::NRar5::CDecoder component when the software attempts to recover from corrupted archive data by filling damaged sections with zeros.

The root cause lies in a miscalculation of the rem value during memory zeroing operations. When processing RAR5 archives, the decoder calls My_ZeroMemory(_window + _winPos, (size_t)rem) where the rem parameter is calculated as _lzEnd - lzSize.

However, the _lzEnd variable depends on the size of previous items in the archive, which can be controlled by attackers.

This miscalculation allows attackers to write zeros beyond the allocated heap buffer, potentially corrupting adjacent memory regions and causing application crashes.


Version-Release number of selected component (if applicable):

p7zip-plugins-16.02-31.el8.x86_64


Additional info:

prior to 25.0.0. Version 25.0.0 contains a fix for the issue.


Note You need to log in before you can comment on or make changes to this bug.