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.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | impacket | 0.9.22-2 | — |
| Debian 13 | impacket | 0.9.22-2 | — |
| Debian 12 | impacket | 0.9.22-2 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | impacket | No fix yet | — |
| Ubuntu 26.04 LTS | impacket | No fix yet | — |
| Ubuntu 25.10 | impacket | No fix yet | — |
| Ubuntu 24.04 LTS | impacket | No fix yet | — |
| Ubuntu 22.04 LTS | impacket | No fix yet | — |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | impacket | No fix yet | — |
| Ubuntu 18.04 LTS | impacket | No fix yet | — |
| Ubuntu 16.04 LTS | impacket | No fix yet | — |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-impacket | 0.11.0-3.3 | openSUSE-SU-2026:12011-1, openSUSE-SU-2024:14142-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | py3-impacket | 0.9.23-r0 | — |
| Alpine v3.23 | py3-impacket | 0.9.23-r0 | — |
| Alpine v3.22 | py3-impacket | 0.9.23-r0 | — |
| Alpine v3.21 | py3-impacket | 0.9.23-r0 | — |
| Alpine v3.20 | py3-impacket | 0.9.23-r0 | — |
Show 6 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | py3-impacket | 0.9.23-r0 | — |
| Alpine v3.18 | py3-impacket | 0.9.23-r0 | — |
| Alpine v3.17 | py3-impacket | 0.9.23-r0 | — |
| Alpine v3.16 | py3-impacket | 0.9.23-r0 | — |
| Alpine v3.15 | py3-impacket | 0.9.23-r0 | — |
| Alpine v3.14 | py3-impacket | 0.9.23-r0 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 2 repositories
-
p0dalirius/CVE-2021-31800-Impacket-SMB-Server-Arbitrary-file-read-write ★ 11 · Aug 28, 2022
A path traversal in smbserver.py allows an attacker to read/write arbitrary files on the server.
-
Louzogh/CVE-2021-31800 ★ 2 · Sep 2, 2022
CVE-2021-31800 POC
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | impacket | < 0.9.23 | 0.9.23 | GHSA-mj63-64x7-57xf |
| PyPI | impacket | >= 0.9.10, < 0.9.23 | 0.9.23 | PYSEC-2021-17 |
Advisories 2
- openSUSE-SU-2026:12011-1 python313-impacket-0.13.1-1.2 on GA media SUSE / openSUSE Security Updates · Oct 5, 2026
- openSUSE-SU-2024:14142-1 python310-impacket-0.11.0-3.3 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
References
- https://github.com/SecureAuthCorp/impacket/releases
- https://github.com/SecureAuthCorp/impacket/blob/cb6d43a677c338db930bc4e9161620832c1ec624/impacket/smbserver.py#L876
- https://github.com/SecureAuthCorp/impacket/blob/cb6d43a677c338db930bc4e9161620832c1ec624/impacket/smbserver.py#L3485
- https://github.com/SecureAuthCorp/impacket/blob/cb6d43a677c338db930bc4e9161620832c1ec624/impacket/smbserver.py#L2008
- https://github.com/SecureAuthCorp/impacket/blob/cb6d43a677c338db930bc4e9161620832c1ec624/impacket/smbserver.py#L2958
- https://github.com/SecureAuthCorp/impacket/commit/49c643bf66620646884ed141c94e5fdd85bcdd2f
- FEDORA-2021-52dfb60726 vendor-advisory
- FEDORA-2021-ab09c9a7a1 vendor-advisory
- FEDORA-2021-888ccfd5b6 vendor-advisory