dpkg: dpkg-deb temporary directory permission handling flaw leading to disk exhaustion DoS (CVE-2025-6297) #shorts

Summary

Today we’re talking about CVE-2025-6297, a vulnerability in the dpkg-deb tool used by Debian and its derivatives. This flaw can lead to denial-of-service conditions on systems that repeatedly extract adversarial .deb packages, ultimately filling up disk space or exhausting user quotas.

Product details

The issue affects dpkg versions before commit ed6bbd445dd8800308c67236ba35d08004c98e82 in Debian. Fedora has also shipped fixes: Fedora 41 upgrades dpkg to version 1.22.20 to address the issue, and Fedora 42 includes the same security patch as part of its dpkg update.

Vulnerability type summary

CVE-2025-6297 is a directory-permission and temporary-file sanitation error in dpkg-deb. By not properly sanitizing control archive extraction paths, it allows repeated execution against crafted .deb files to consume all available disk space, causing a local denial of service.

Details of the vulnerability

When dpkg-deb extracts the control member of a .deb into a temporary directory, it assumes that directory cleanup is always permitted. If that directory is placed on a filesystem with quotas or restricted permissions, malicious packages can force dpkg-deb to leave behind large, well-compressible files. Automated or repeated extractions then fill the disk or hit quota limits. Over time this leads to broken package installations, failed upgrades, or full disks that require administrator intervention to clean up.

Conclusion

CVE-2025-6297 is not a remote code execution flaw, but its impact can cripple package management on affected systems. Administrators should immediately upgrade dpkg to the patched versions in Debian and Fedora, remove any leftover temporary files, and verify disk usage. Prompt patching will restore the intended safe-operation guarantees of dpkg-deb.

Watch the full video on YouTube: CVE-2025-6297

Remediation and exploitation details

This chain involves the following actors

  • Attacker: crafts and executes malicious package extraction to exhaust disk space
  • System Administrator: maintains and secures dpkg environments

This following systems are involved

  • Debian dpkg-deb (extract Debian package archives): package installation and manipulation tool
  • Temporary Directory (holds extracted control files during dpkg-deb operations): cleanup area for extraction

Attack entry point

  • Adversarial .deb package: malformed package with control archive entries that set restrictive permissions on extracted directories

Remediation actions

System Administrator
apply vendor patch
Debian dpkg package updated to commit ed6bbd445dd8800308c67236ba35d08004c98e82 or newer
System Administrator
upgrade Fedora dpkg
dpkg version 1.22.20 or later
System Administrator
avoid extracting untrusted packages
dpkg-deb
System Administrator
enforce proper temporary directory permissions
filesystem hosting dpkg-deb temporary directory

Exploitation actions

Create a control.tar.* that defines a subdirectory with permissions preventing non-root removal

Attacker
prepare malicious package
Debian dpkg-deb
Examples:
  • Embed a directory 'tmp/' in control.tar.gz and set mode 0555 to block cleanup

Invoke dpkg-deb --control on the malicious .deb in a directory where the user cannot remove files

Attacker
launch repeated extractions
Debian dpkg-deb
Examples:
  • mkdir /var/lockdir && chmod 555 /var/lockdir && dpkg-deb --control evil.deb /var/lockdir

Repeat extraction in the same protected directory so leftover control files cannot be deleted

Attacker
allow leftover files to accumulate
Temporary Directory
Examples:
  • Run the extraction command hundreds of times to stack up orphaned files

Fill available disk or user quota to prevent further installations or operations

Attacker
trigger disk exhaustion
Debian dpkg-deb
Examples:
  • Subsequent package manager operations fail with 'no space left on device' errors

Related Content

NOTE: The following related content has not been vetted and may be unsafe.

CVE database technical details

CVE ID
CVE-2025-6297
Description
It was discovered that dpkg-deb does not properly sanitize directory permissions when extracting a control member into a temporary directory, which is documented as being a safe operation even on untrusted data. This may result in leaving temporary files behind on cleanup. Given automated and repeated execution of dpkg-deb commands on adversarial .deb packages or with well compressible files, placed inside a directory with permissions not allowing removal by a non-root user, this can end up in a DoS scenario due to causing disk quota exhaustion or disk full conditions.
Provider
debian
CWE / problem types
Affected Software Versions
Debian:dpkg:[{'lessThan': 'ed6bbd445dd8800308c67236ba35d08004c98e82', 'status': 'affected', 'version': '0', 'versionType': 'custom'}]
Date Published
2025-07-01T16:16:54.624Z
Last Updated
2025-07-01T17:30:37.332Z