Path Traversal Vulnerability in Impacket Package
Summary
DEBIAN-CVE-2021-31800: Multiple path traversal vulnerabilities exist in smbserver.py in Impacket through 0.9.22. Affects impacket versions < 0.9.22-2. Fixed in 0.9.22-2. 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
Impacket is a collection of Python classes for working with network protocols. It is widely used for network communication and penetration testing. The package provides tools to create and manipulate network packets, making it essential for security professionals. However, it has been found to have multiple path traversal vulnerabilities that can be exploited by attackers.
Vulnerability Detail
Multiple path traversal vulnerabilities exist in smbserver.py in Impacket through version 0.9.22. An attacker connecting to a running smbserver instance can list and write to arbitrary files using '..' directory traversal. This vulnerability could potentially allow an attacker to replace critical system files, such as /etc/shadow or an SSH authorized key, leading to arbitrary code execution.
How To Fix
Minimum fixed version
0.9.22-2
This is the first release that contains the fix.
sudo apt-get install --only-upgrade impacket
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, restrict access to the smbserver instance to trusted users only, and monitor the server for any unauthorized access attempts.
Conclusion
The Impacket package has a critical path traversal vulnerability that can be exploited by attackers to gain unauthorized access to sensitive files. It is crucial to update to the patched version to mitigate this risk. Implementing access controls can serve as a temporary measure until the update is applied.
See every vulnerability recorded for impacket →
FAQ
A path traversal vulnerability allows an attacker to access files and directories that are stored outside the intended directory structure, potentially leading to unauthorized data access.
If exploited, this vulnerability can allow attackers to read sensitive files or execute arbitrary code, compromising the security of your system.
Versions of Impacket prior to 0.9.22-2 are affected by this vulnerability. Check your version and update if necessary.
Implement access controls to limit who can connect to the smbserver and monitor for any suspicious activity until you can apply the update.
You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities using a manifest file like package-lock.json. You can also check your application for vulnerabilities using the Vulert playground without any signup.
References
Related vulnerabilities
Recent vulnerabilities recorded for impacket.