CVE-2021-31800 is a critical-severity (CVSS 9.8) Path Traversal vulnerability in impacket. 2 public exploit or proof-of-concept references are indexed, so weaponization risk is real. A fix is available for impacket — see the affected versions and patch details below.
Path traversal in impacket
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
impacketReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Multiple path traversal vulnerabilities exist in smbserver.py in Impacket through 0.9.22. An attacker that connects to a running smbserver instance can list and write to arbitrary files via ../ directory traversal. This could potentially be abused to achieve arbitrary code execution by replacing /etc/shadow or an SSH authorized key.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | impacket | all versions | 0.9.23pip install --upgrade 'impacket==0.9.23' |
Affected Products
fedorafedoraprojectimpacketsecureauthResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for impacket, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update impacket to 0.9.23 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-31800 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Frequently Asked Questions
Is CVE-2021-31800 in your dependencies?
Find it across PyPI, including transitive dependencies.