VAITP Dataset

← Back to the dataset

CVE-2026-102643

AsyncSSH SFTP chroot bypass via double‑slash path leads to directory escape.

  • CVSS 8.8
  • CWE-22
  • Input Validation and Sanitization
  • Remote

AsyncSSH is a Python package which provides an asynchronous client and server implementation of the SSHv2 protocol on top of the Python asyncio framework. Prior to 2.24.1, SFTPServer.map_path() uses posixpath.normpath() on a client-supplied path and removes only one leading slash before passing the result to posixpath.join() with the configured chroot. An authenticated SFTP user can supply a path beginning with exactly two slash characters, causing POSIX normalization to preserve the double-leading-slash form and the subsequent join to treat the remaining pathname as absolute. This bypasses the SFTP chroot and permits reads and writes with the operating-system permissions of the account running the server, which may enable code execution depending on writable targets. This issue is fixed in version 2.24.1.

CVSS base score
8.8
Published
2026-11-09
OWASP
A01 Broken Access Control
Orthogonal defect classification
Interface
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Path Traversal
Accessibility scope
Remote
Impact
Privilege Escalation
Affected component
AsyncSSH
Fixed by upgrading
Yes

Solution

Upgrade AsyncSSH to version 2.24.1 or later.

Vulnerable code sample

import asyncssh
import posixpath

class MySFTPServer(asyncssh.SFTPServer):
    def __init__(self, chan):
        super().__init__(chan)
        self._chroot = '/srv/sftp'

    # VULNERABLE: double-leading-slash bypasses chroot
    def map_path(self, path):
        # Normalize client-supplied path
        norm = posixpath.normpath(path)
        # Remove only one leading slash
        if norm.startswith('/'):
            norm = norm[1:]
        # Join with chroot; double-leading-slash can escape
        return posixpath.join(self._chroot, norm)

Patched code sample

import asyncssh
import posixpath

class MySFTPServer(asyncssh.SFTPServer):
    def __init__(self, chan):
        super().__init__(chan)
        self._chroot = '/srv/sftp'

    # FIX: strip all leading slashes to prevent escape
    def map_path(self, path):
        # Normalize client-supplied path
        norm = posixpath.normpath(path)
        # Remove any leading slashes
        norm = norm.lstrip('/')
        # Join with chroot safely
        return posixpath.join(self._chroot, norm)

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

Cite this entry

@misc{vaitp:cve2026102643,
  title        = {{AsyncSSH SFTP chroot bypass via double‑slash path leads to directory escape.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-102643},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-102643/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.