Intel

AIKIDO-2026-651819

asyncssh is vulnerable to Race Condition (TOCTOU)

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Oct 13, 2026
October 13, 2026

64

CVE Score

Medium

Race Condition (TOCTOU)

Are you affected? Scan for Free

TL;DR

_process_userauth_request() in asyncssh/connection.py passes each SSH_MSG_USERAUTH_REQUEST to _finish_userauth() through a detached create_task() call, so a new request can run before the previous one finishes. A new request sets _username while the earlier attempt is still running, and that earlier attempt can still report success, so the server records the wrong username as the authenticated user. The fix cancels the previous attempt and accepts success only from the attempt that is still active.

How do I fix this?

Upgrade the asyncssh library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Package

Versions

1.12.0 - 2.24.0

Fixed in 2.24.1

Background info

asyncssh is vulnerable to Race Condition (TOCTOU) in versions 1.12.0 - 2.24.0.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea