CVE-2026-40178
Python vulnerability analysis and mitigation

Overview

CVE-2026-40178 is a race condition vulnerability in the ajenti.plugin.core Python package that allows an unauthenticated attacker to bypass two-factor authentication (2FA) during a brief window immediately following a user's successful authentication. It affects all versions of ajenti.plugin.core up to and including 0.111, and was disclosed on April 9–10, 2026 by researcher hansmach1ne via the GitHub Security Advisory GHSA-8647-755q-fw9p. The vulnerability carries a CVSS v4.0 base score of 6.9 (Medium) and a CVSS v3.1 base score of 5.9 (Medium) (GitHub Advisory, Ajenti Advisory).

Technical details

The root cause is a race condition (CWE-362) combined with improper authentication enforcement (CWE-287) in the 2FA implementation of ajenti.plugin.core. After a user completes primary credential authentication but before the 2FA verification step is fully enforced, a brief timing window exists during which the authentication state can be accessed or manipulated without completing the second factor. An unauthenticated network attacker with no privileges required can exploit this window by racing concurrent requests against the authentication flow, effectively bypassing the 2FA check. No user interaction is required, though the high attack complexity rating reflects the need to precisely time the exploit (GitHub Advisory, Ajenti Advisory).

Impact

Successful exploitation allows an attacker to bypass 2FA and gain unauthorized access to an Ajenti web-based server administration panel, which typically provides full control over the underlying server. The CVSS v4.0 scoring reflects high impact to both confidentiality and integrity of the vulnerable system, as an attacker who gains access to the Ajenti panel can read sensitive configuration data, modify system settings, execute commands, and potentially pivot to other systems managed through the panel. Availability is not directly impacted by the authentication bypass itself, but full administrative access could enable destructive actions (GitHub Advisory).

Exploitability

No public proof-of-concept exploit code has been identified, and there is no evidence of in-the-wild exploitation at this time. The EPSS score is approximately 0.017% (4th percentile), indicating a low near-term probability of exploitation (GitHub Advisory). The exploit maturity is rated as "Unreported" in CVSS v4.0 scoring, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The high attack complexity requirement — needing precise timing to win the race condition — raises the bar for reliable exploitation.

Exploitation steps

  1. Reconnaissance: Identify internet-facing Ajenti instances running ajenti.plugin.core versions ≤ 0.111 with 2FA enabled, using tools like Shodan or Censys searching for Ajenti's default port (8000) or its web interface fingerprint.
  2. Initiate authentication: Submit valid primary credentials (username and password) to the Ajenti login endpoint to trigger the authentication flow and advance the session to the 2FA pending state.
  3. Race the 2FA window: Immediately and concurrently send additional authenticated requests (e.g., API calls or page requests that require a fully authenticated session) during the brief window between primary credential acceptance and 2FA enforcement, attempting to access protected resources before the 2FA gate is applied.
  4. Achieve authentication bypass: If the race condition is won, the attacker's session is treated as fully authenticated without completing the 2FA step, granting access to the Ajenti administrative panel.
  5. Post-exploitation: Use the Ajenti panel's administrative capabilities to execute system commands, modify configurations, install backdoors, or exfiltrate sensitive data from the managed server (GitHub Advisory, Ajenti Advisory).

Indicators of compromise

  • Network: Rapid succession of HTTP requests to the Ajenti login endpoint followed immediately by requests to authenticated/administrative endpoints from the same source IP, without a corresponding 2FA completion request in between.
  • Logs: Ajenti access logs showing a session transitioning from the 2FA-pending state to authenticated administrative actions without a recorded 2FA token submission; multiple near-simultaneous login attempts from the same IP.
  • Logs: Unexpected administrative actions (e.g., command execution, configuration changes, user management) in Ajenti audit logs attributed to a user account shortly after login, with no 2FA event recorded.
  • Process: Unusual child processes spawned by the Ajenti service process following a suspicious login event, potentially indicating post-exploitation command execution.

Mitigation and workarounds

The vulnerability is fixed in ajenti.plugin.core version 0.112. Users should upgrade immediately by running pip install --upgrade ajenti.plugin.core or following the standard Ajenti upgrade procedure (GitHub Advisory, Ajenti Advisory). As a temporary workaround for those unable to upgrade immediately, consider restricting network access to the Ajenti panel (e.g., via firewall rules or VPN) to reduce exposure to untrusted networks. There is no configuration-based workaround that fully mitigates the race condition without patching.

Community reactions

The vulnerability was credited to researcher hansmach1ne, who reported it through GitHub's security advisory process (Ajenti Advisory). A brief post on Bluesky noted the CVE publication, and a technical summary was published at infinitsec.net shortly after disclosure. Overall community reaction has been limited, consistent with the moderate severity rating and low EPSS score.

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-50027CRITICAL9.8
  • Python logoPython
  • mcp-memory-service
NoYesAug 14, 2026
CVE-2026-49986HIGH7.1
  • Python logoPython
  • neuro-cortex-memory
NoYesAug 14, 2026
CVE-2026-53708MEDIUM6.6
  • Python logoPython
  • mcp-contextforge-gateway
NoYesAug 14, 2026
CVE-2026-47192LOW2.1
  • Python logoPython
  • kas
NoYesAug 14, 2026
CVE-2026-47191LOW2.1
  • Python logoPython
  • kas
NoYesAug 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management