Skip to content
Heist/ feed
Back to feed
Critical

impacket — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2021-31800

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.

Products
impacket
Affected versions
0.11.0-1, 0.11.0-2, 0.12.0-3, 0.13.0-1, 0.13.0-2, 0.9.12-1, 0.9.15-1, 0.9.15-5, 0.9.20-4, 0.9.20-5, 0.9.22-2, 0.9.24-1
Fixed versions
Not specified
CVEs
CVE-2021-31800
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 00:34 UTC · Revision 1

Source evidence

UBUNTU-CVE-2021-31800

core-osv · Original source

Published 5 May 2021, 11:15 UTC

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.

osv:UBUNTU-CVE-2021-31800

impacket

Fixed versions: Not specified

impacket

Fixed versions: Not specified

impacket

Fixed versions: Not specified

impacket

Fixed versions: Not specified

impacket

Fixed versions: Not specified

impacket

Fixed versions: Not specified

impacket

Fixed versions: Not specified

impacket

Fixed versions: Not specified

Complete source record
{
  "id": "a6173d01a478f14bd4e837ecf835d93254792af0330b9c78be6b8e4a9925596c",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2021-31800",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2021-31800",
    "summary": "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.",
    "evidence": "osv:UBUNTU-CVE-2021-31800",
    "products": [
      {
        "name": {
          "value": "impacket",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.9.12-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "impacket",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.9.15-1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "impacket",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.9.15-5",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "0.9.20-4",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "0.9.20-5",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "impacket",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.9.22-2",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "0.9.24-1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "impacket",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.11.0-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "0.11.0-2",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "impacket",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.12.0-3",
            "evidence": "/affected/5/versions"
          }
        ]
      },
      {
        "name": {
          "value": "impacket",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.13.0-2",
            "evidence": "/affected/6/versions"
          }
        ]
      },
      {
        "name": {
          "value": "impacket",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.12.0-3",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "0.13.0-1",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "0.13.0-2",
            "evidence": "/affected/7/versions"
          }
        ]
      }
    ],
    "severity": "critical",
    "structured": {
      "id": "UBUNTU-CVE-2021-31800",
      "aliases": [
        "UBUNTU-CVE-2021-31800"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "impacket",
            "purl": "pkg:deb/ubuntu/impacket?arch=source&distro=xenial",
            "ecosystem": "Ubuntu:16.04:LTS"
          },
          "versions": [
            "0.9.12-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-31800.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python-impacket",
                "binary_version": "0.9.12-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "impacket",
            "purl": "pkg:deb/ubuntu/impacket?arch=source&distro=bionic",
            "ecosystem": "Ubuntu:18.04:LTS"
          },
          "versions": [
            "0.9.15-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-31800.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python-impacket",
                "binary_version": "0.9.15-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "impacket",
            "purl": "pkg:deb/ubuntu/impacket?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "0.9.15-5",
            "0.9.20-4",
            "0.9.20-5"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-31800.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python3-impacket",
                "binary_version": "0.9.20-5"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "impacket",
            "purl": "pkg:deb/ubuntu/impacket?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "0.9.22-2",
            "0.9.24-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-31800.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python3-impacket",
                "binary_version": "0.9.24-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "impacket",
            "purl": "pkg:deb/ubuntu/impacket?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "0.11.0-1",
            "0.11.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-31800.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python3-impacket",
                "binary_version": "0.11.0-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "impacket",
            "purl": "pkg:deb/ubuntu/impacket?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "0.12.0-3"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-31800.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python3-impacket",
                "binary_version": "0.12.0-3"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "impacket",
            "purl": "pkg:deb/ubuntu/impacket?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "0.13.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-31800.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python3-impacket",
                "binary_version": "0.13.0-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "impacket",
            "purl": "pkg:deb/ubuntu/impacket?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "0.12.0-3",
            "0.13.0-1",
            "0.13.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-31800.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python3-impacket",
                "binary_version": "0.13.0-2"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:55:46.337240963Z",
      "provider": "osv",
      "upstream": [
        "CVE-2021-31800"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2021-31800",
        "https://github.com/SecureAuthCorp/impacket/commit/49c643bf66620646884ed141c94e5fdd85bcdd2f",
        "https://github.com/SecureAuthCorp/impacket/blob/cb6d43a677c338db930bc4e9161620832c1ec624/impacket/smbserver.py#L2008",
        "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#L2958",
        "https://github.com/SecureAuthCorp/impacket/blob/cb6d43a677c338db930bc4e9161620832c1ec624/impacket/smbserver.py#L3485",
        "https://www.cve.org/CVERecord?id=CVE-2021-31800"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2021-31800",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 354048,
  "published_at": "2021-05-05T11:15:00+00:00"
}