Vulnerability · Published May 5, 2021 · Assigned by mitre
CVE-2021-31800
Critical 9.8
In plain English
A critical-severity security flaw in the py3-impacket package (Alpine). There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 19.4% (higher than 97% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | py3-impacket | 0.9.23-r0 | ALPINE-CVE-2021-31800 |
| Alpine:v3.21 | py3-impacket | 0.9.23-r0 | ALPINE-CVE-2021-31800 |
| Alpine:v3.22 | py3-impacket | 0.9.23-r0 | ALPINE-CVE-2021-31800 |
| Alpine:v3.23 | py3-impacket | 0.9.23-r0 | ALPINE-CVE-2021-31800 |
| Alpine:v3.24 | py3-impacket | 0.9.23-r0 | ALPINE-CVE-2021-31800 |
| Debian:12 | impacket | 0.9.22-2 | DEBIAN-CVE-2021-31800 |
| Debian:13 | impacket | 0.9.22-2 | DEBIAN-CVE-2021-31800 |
| Debian:14 | impacket | 0.9.22-2 | DEBIAN-CVE-2021-31800 |
| PyPI | impacket | 0.9.23 | PYSEC-2021-17 |
| PyPI | impacket | 0.9.23 | GHSA-mj63-64x7-57xf |
| Ubuntu:22.04:LTS | impacket | no fix listed | UBUNTU-CVE-2021-31800 |
| Ubuntu:24.04:LTS | impacket | no fix listed | UBUNTU-CVE-2021-31800 |
| Ubuntu:25.10 | impacket | no fix listed | UBUNTU-CVE-2021-31800 |
| Ubuntu:26.04:LTS | impacket | no fix listed | UBUNTU-CVE-2021-31800 |
| Ubuntu:26.10 | impacket | no fix listed | UBUNTU-CVE-2021-31800 |
Affected products (as reported)
References
- https://github.com/SecureAuthCorp/impacket/releases x_refsource_MISC
- https://github.com/SecureAuthCorp/impacket/blob/cb6d43a677c338db930bc4e9161620832c1ec624/impacket/smbserver.py#L876 x_refsource_MISC
- https://github.com/SecureAuthCorp/impacket/blob/cb6d43a677c338db930bc4e9161620832c1ec624/impacket/smbserver.py#L3485 x_refsource_MISC
- https://github.com/SecureAuthCorp/impacket/blob/cb6d43a677c338db930bc4e9161620832c1ec624/impacket/smbserver.py#L2008 x_refsource_MISC
- https://github.com/SecureAuthCorp/impacket/blob/cb6d43a677c338db930bc4e9161620832c1ec624/impacket/smbserver.py#L2958 x_refsource_MISC
- https://github.com/SecureAuthCorp/impacket/commit/49c643bf66620646884ed141c94e5fdd85bcdd2f x_refsource_MISC
- FEDORA-2021-52dfb60726 vendor-advisory, x_refsource_FEDORA
- FEDORA-2021-ab09c9a7a1 vendor-advisory, x_refsource_FEDORA
- FEDORA-2021-888ccfd5b6 vendor-advisory, x_refsource_FEDORA