CVE-2026-62949: AsyncSSH Asyncio Event-loop Freeze Vulnerability

MODERATE
Advisory Identifier: GHSA-rw4j-r22c-9gc3
CVSS 6.5
CWE-835
Published
Advisory Summary

CVE-2026-62949 is a MODERATE (CVSS 6.5) asyncio event-loop freeze vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting AsyncSSH libraries in the PyPI ecosystem. The issue involves asyncio event-loop freeze via ssh maximum packet size = 0 in ssh_msg_channel_open / open_confirmation. Remediation is available by upgrading affected packages to version 2.24.0.

CVE-2026-62949 at a Glance

CVE Identifier CVE-2026-62949
GHSA Identifier GHSA-rw4j-r22c-9gc3
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product AsyncSSH
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-62949

To remediate this vulnerability, upgrade all affected AsyncSSH dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

asyncssh fixed: 2.24.0
pip install asyncssh>=2.24.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show asyncssh

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-62949, inspect your installed packages using pip:

pip show asyncssh

Analyze the terminal output to locate any version of AsyncSSH in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.24.0), your application is affected.

Note: The pip show asyncssh command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In AsyncSSH, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary A malicious SSH server can wedge an AsyncSSH **client**, and an authenticated client can wedge an AsyncSSH **server**, by sending a channel `maximum packet size` of `0` in `SSH_MSG_CHANNEL_OPEN_CONFIRMATION` (server→client) or `SSH_MSG_CHANNEL_OPEN` (client→server). AsyncSSH stores the peer-supplied value verbatim with no lower-bound check; the first time channel data is written, `SSHChannel._flush_send_buf` enters a **synchronous infinite loop** that cannot be interrupted by `asyncio.wait_for` or any timeout. The loop body has no `await`, so it blocks the entire asyncio event loop — for a server, one malicious authenticated channel freezes **all** current and future connections. RFC 4254 §5.1 leaves receiver behavior for a peer-reported "maximum packet size = 0" undefined, so the value must be rejected rather than stored. ## Root cause `asyncssh/channel.py`: ```python # process_open (server side) -- line 465 self._send_pktsize = send_pktsize # peer value, no >= 1 check # process_open_confirmation (client) -- line 528 self._send_pktsize = send_pktsize # peer value, no >= 1 check # _flush_send_buf -- lines 305-320 while self._send_buf and self._send_window: pktsize = min(self._send_window, self._send_pktsize) # 0 when peer sends 0 buf, datatype = self._send_buf[0] if len(buf) > pktsize: # True for any buffered data data = buf[:pktsize] # empty (b'') del buf[:pktsize] # no-op ... self._send_window -= len(data) # -= 0, unchanged ``` With `_send_pktsize == 0`, `pktsize` is `0`, so `buf[:0]` is empty, `del buf[:0]` is a no-op, and `_send_window` is never decremented — the `while` condition is permanently true, and with no `await` in the body the event loop is blocked. ## Impact - **Client vector (primary):** a malicious SSH server replies to the client's channel open with `maximum packet size = 0`; the client wedges on its first channel write. The attacker is the server, so it needs no valid credentials. - **Server vector:** an authenticated client opens a channel with `maximum packet size = 0`; any server-side channel write wedges the AsyncSSH server's event loop, freezing **every** current and future connection. A single low-privilege account can take the whole server down. Both vectors are a single SSH message, deterministic, and cause total availability loss for the affected process. ## Affected versions <= 2.23.1 (latest release, 2026-06-06); also present on `master` (channel.py:465/528 unguarded). Verified end-to-end on 2.23.1. ## Verification The maintainer's proposed fix (reject `send_pktsize == 0` in `connection.py` `_process_channel_open` / `_process_channel_open_confirmation`) was applied to 2.23.1 and re-tested end-to-end over TCP: - **Unpatched:** malicious server (paramiko forcing `max_packet_size=0` in OPEN_CONFIRMATION) + real asyncssh client → client event loop wedges. - **Patched:** the guard fires inside `_process_channel_open_confirmation`, the malicious value is rejected, the connection closes cleanly (`ChannelOpenError: SSH connection closed`), and the client does **not** wedge. The maintainer (Ron Frederick) independently confirmed the freeze and noted that **even shutting the server down does not break clients out of the loop**. Reproducers available: a focused harness driving the real `SSHChannel._flush_send_buf` with `_send_pktsize=0`, and an end-to-end `malicious_server.py` (paramiko) + `client.py` (real asyncssh) pair. The end-to-end client repro uses `asyncio.new_event_loop()` (not `get_event_loop()`) for Python 3.14 compatibility. ## Suggested fix (maintainer's approach) In `connection.py`, after each `send_pktsize = packet.get_uint32()` in `_process_channel_open` and `_process_channel_open_confirmation`: ```python if send_pktsize == 0: raise ProtocolError('Invalid maximum packet size') ``` ## CVSS `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H` (6.5 Medium). An earlier draft quoted 7.5 High ("100% CPU"); the synchronous loop burns ~100% of one core's worth of CPU but, being single-threaded, the OS scheduler spreads it across cores, so the real impact is event-loop / connection freeze, not machine-wide CPU exhaustion. ## References - RFC 4254 §5.1 (channel "maximum packet size"; behavior for 0 is undefined). - The same `maximum packet size = 0` send-loop wedge was confirmed in several other independent SSH implementations (different languages/runtimes) and reported to each maintainer separately. ## Credits Reported by zhangph (afldl), 2026-06-20. ```

CVE-2026-62949 Affected AsyncSSH Versions

1 component(s)
Fixed Versions:
2.24.0
Product / Package Ecosystem Affected Versions Fixed Version
asyncssh
PyPI
< 2.24.0
2.24.0

References

Frequently Asked Questions

What is CVE-2026-62949?
CVE-2026-62949 is a security vulnerability in AsyncSSH involving asyncio event-loop freeze via SSH maximum packet size = 0 in SSH_MSG_CHANNEL_OPEN / OPEN_CONFIRMATION under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which AsyncSSH versions are affected?
Affected versions include releases prior to 2.24.0 across affected packages: asyncssh.
What version fixes CVE-2026-62949?
Upgrading to 2.24.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is asyncssh affected?
Yes, asyncssh is affected in releases prior to 2.24.0. Upgrade your dependency to 2.24.0 or later.
What is the CVSS score of CVE-2026-62949?
CVE-2026-62949 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-62949?
CVE-2026-62949 is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') (The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.).
How can I check PyPI dependencies for CVE-2026-62949?
Run the dependency tree command: 'pip show asyncssh'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rw4j-r22c-9gc3",
  "modified" : "2026-09-17T14:53:01Z",
  "published" : "2026-09-17T14:53:01Z",
  "aliases" : [ "CVE-2026-62949" ],
  "summary" : "AsyncSSH: asyncio event-loop freeze via SSH maximum packet size = 0 in SSH_MSG_CHANNEL_OPEN / OPEN_CONFIRMATION",
  "details" : "## Summary\n\nA malicious SSH server can wedge an AsyncSSH **client**, and an authenticated\nclient can wedge an AsyncSSH **server**, by sending a channel `maximum packet\nsize` of `0` in `SSH_MSG_CHANNEL_OPEN_CONFIRMATION` (server→client) or\n`SSH_MSG_CHANNEL_OPEN` (client→server). AsyncSSH stores the peer-supplied value\nverbatim with no lower-bound check; the first time channel data is written,\n`SSHChannel._flush_send_buf` enters a **synchronous infinite loop** that cannot\nbe interrupted by `asyncio.wait_for` or any timeout. The loop body has no\n`await`, so it blocks the entire asyncio event loop — for a server, one\nmalicious authenticated channel freezes **all** current and future connections.\n\nRFC 4254 §5.1 leaves receiver behavior for a peer-reported \"maximum packet\nsize = 0\" undefined, so the value must be rejected rather than stored.\n\n## Root cause\n\n`asyncssh/channel.py`:\n\n```python\n# process_open (server side)        -- line 465\nself._send_pktsize = send_pktsize    # peer value, no >= 1 check\n\n# process_open_confirmation (client) -- line 528\nself._send_pktsize = send_pktsize    # peer value, no >= 1 check\n\n# _flush_send_buf                    -- lines 305-320\nwhile self._send_buf and self._send_window:\n    pktsize = min(self._send_window, self._send_pktsize)  # 0 when peer sends 0\n    buf, datatype = self._send_buf[0]\n    if len(buf) > pktsize:          # True for any buffered data\n        data = buf[:pktsize]        # empty (b'')\n        del buf[:pktsize]           # no-op\n    ...\n    self._send_window -= len(data)  # -= 0, unchanged\n```\n\nWith `_send_pktsize == 0`, `pktsize` is `0`, so `buf[:0]` is empty,\n`del buf[:0]` is a no-op, and `_send_window` is never decremented — the\n`while` condition is permanently true, and with no `await` in the body the\nevent loop is blocked.\n\n## Impact\n\n- **Client vector (primary):** a malicious SSH server replies to the client's\n  channel open with `maximum packet size = 0`; the client wedges on its first\n  channel write. The attacker is the server, so it needs no valid credentials.\n- **Server vector:** an authenticated client opens a channel with\n  `maximum packet size = 0`; any server-side channel write wedges the AsyncSSH\n  server's event loop, freezing **every** current and future connection. A\n  single low-privilege account can take the whole server down.\n\nBoth vectors are a single SSH message, deterministic, and cause total\navailability loss for the affected process.\n\n## Affected versions\n\n<= 2.23.1 (latest release, 2026-06-06); also present on `master`\n(channel.py:465/528 unguarded). Verified end-to-end on 2.23.1.\n\n## Verification\n\nThe maintainer's proposed fix (reject `send_pktsize == 0` in `connection.py`\n`_process_channel_open` / `_process_channel_open_confirmation`) was applied to\n2.23.1 and re-tested end-to-end over TCP:\n\n- **Unpatched:** malicious server (paramiko forcing `max_packet_size=0` in\n  OPEN_CONFIRMATION) + real asyncssh client → client event loop wedges.\n- **Patched:** the guard fires inside `_process_channel_open_confirmation`, the\n  malicious value is rejected, the connection closes cleanly\n  (`ChannelOpenError: SSH connection closed`), and the client does **not** wedge.\n\nThe maintainer (Ron Frederick) independently confirmed the freeze and noted that\n**even shutting the server down does not break clients out of the loop**.\n\nReproducers available: a focused harness driving the real\n`SSHChannel._flush_send_buf` with `_send_pktsize=0`, and an end-to-end\n`malicious_server.py` (paramiko) + `client.py` (real asyncssh) pair. The\nend-to-end client repro uses `asyncio.new_event_loop()` (not `get_event_loop()`)\nfor Python 3.14 compatibility.\n\n## Suggested fix (maintainer's approach)\n\nIn `connection.py`, after each `send_pktsize = packet.get_uint32()` in\n`_process_channel_open` and `_process_channel_open_confirmation`:\n\n```python\nif send_pktsize == 0:\n    raise ProtocolError('Invalid maximum packet size')\n```\n\n## CVSS\n\n`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H` (6.5 Medium). An earlier draft\nquoted 7.5 High (\"100% CPU\"); the synchronous loop burns ~100% of one core's\nworth of CPU but, being single-threaded, the OS scheduler spreads it across\ncores, so the real impact is event-loop / connection freeze, not machine-wide\nCPU exhaustion.\n\n## References\n\n- RFC 4254 §5.1 (channel \"maximum packet size\"; behavior for 0 is undefined).\n- The same `maximum packet size = 0` send-loop wedge was confirmed in several\n  other independent SSH implementations (different languages/runtimes) and\n  reported to each maintainer separately.\n\n## Credits\n\nReported by zhangph (afldl), 2026-06-20.\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "asyncssh"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.24.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.23.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ronf/asyncssh/security/advisories/GHSA-rw4j-r22c-9gc3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-62949"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ronf/asyncssh/commit/756cbae5350789ce9735f15f704bae9b5a3608b8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ronf/asyncssh/commit/9c354270c009285525e126721e8ed5fbed1f8a67"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ronf/asyncssh"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ronf/asyncssh/releases/tag/v2.24.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-17T14:53:01Z",
    "nvd_published_at" : "2026-09-16T20:17:26Z"
  }
}