Directory Traversal Vulnerability in dpkg Package Manager
Summary
CVE-2022-1664: Dpkg::Source::Archive in dpkg, the Debian package management system, before version 1.21.8, 1.20.10, 1.19.8, 1.18.26 is prone to a directory traversal vulnerability. Affects dpkg across 5 version ranges.
< 1.20.10-r0
< 1f23dddc17f69c9598477098c7fb9936e15fa495
< 7a6c03cb34d4a09f35df2f10779cbf1b70a5200b
< 58814cacee39c4ce9e2cd0e3a3b9b57ad437eff5
< faa4c92debe45412bfcf8a44f26e827800bb24be
Fixed in 1.20.10-r0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The dpkg package management system is widely used in Debian-based Linux distributions for installing, upgrading, and removing software packages. It is responsible for handling the installation and maintenance of packages, including their dependencies. The vulnerability identified as CVE-2022-1664 affects versions of dpkg prior to 1.21.8, 1.20.10, 1.19.8, and 1.18.26. This vulnerability specifically targets the extraction of untrusted source packages in v2 and v3 source package formats that include a debian.tar. Exploiting this vulnerability can lead to directory traversal situations when processing specially crafted orig.tar and debian.tar tarballs.
Vulnerability Detail
The directory traversal vulnerability in dpkg's Dpkg::Source::Archive module allows an attacker to manipulate the extraction process of untrusted source packages. By crafting malicious orig.tar and debian.tar tarballs, an attacker can trick dpkg into extracting files to unintended directories outside the intended extraction path. This can result in arbitrary file overwrites, unauthorized access to sensitive files, and potential remote code execution. The vulnerability has a CVSSv3 score of 9.8, indicating its critical severity.
How To Fix
Minimum fixed version
1.20.10-r0
This is the first release that contains the fix.
sudo apk add --upgrade dpkg
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can exercise caution when handling untrusted source packages. It is advisable to verify the integrity and authenticity of source packages before extraction. Additionally, users can consider implementing strict file permissions and access controls to limit the impact of a potential exploitation. However, applying the official fix by updating dpkg is the recommended long-term solution.
Conclusion
The directory traversal vulnerability in dpkg poses a significant risk to systems using vulnerable versions of the package manager. It is crucial to promptly update dpkg to the patched versions to mitigate the risk of arbitrary file overwrites, unauthorized access, and potential remote code execution. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for dpkg →
FAQ
dpkg is a package management system used in Debian-based Linux distributions, responsible for installing, upgrading, and removing software packages.
Exploiting this vulnerability can lead to arbitrary file overwrites, unauthorized access to sensitive files, and potential remote code execution.
To fix this vulnerability, update dpkg to the patched versions: 1.21.8, 1.20.10, 1.19.8, or 1.18.26, depending on your distribution and version.
As a temporary workaround, exercise caution when handling untrusted source packages and consider implementing strict file permissions and access controls.
The CVSSv3 score of this vulnerability is 9.8, indicating its critical severity.
Related vulnerabilities
Recent vulnerabilities recorded for dpkg.