CVE-2021-31800 Path traversal in impacket
Attackers can traverse directories to read or write arbitrary files, potentially achieving code execution by modifying system files like SSH keys.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-31800?
CVE-2021-31800 is a critical path traversal vulnerability in Fedoraproject Fedora, published on 5 May 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-22
Which versions are affected by CVE-2021-31800?
3 open source packages ship an affected version, including impacket. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
impacket PyPI | All versions | 0.9.23 |
impacket PyPI | All versions | 0.9.23 |
impacket PyPI | From 0.9.10 | 0.9.23 |
Linux distribution packages (1)
python-impacket openSUSE:Tumbleweed | All versions | 0.11.0-3.3 |
Products include Fedoraproject Fedora, Secureauth Impacket.
How do I fix CVE-2021-31800?
Upgrade impacket to 0.9.23 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2021-31800 being exploited?
There is no known exploitation of CVE-2021-31800 in the wild and no public exploit code.
Public exploit code: 2 proofs of concept on GitHub.
Other vulnerabilities in Fedoraproject Fedora
Sources
Also known as DEBIAN-CVE-2021-31800, GHSA-mj63-64x7-57xf, PYSEC-2021-17, UBUNTU-CVE-2021-31800, openSUSE-SU-2024:11232-1, openSUSE-SU-2024:14142-1.