
Proof-of-concept exploit for CVE-2026-49757 demonstrating OAuth2/OIDC account takeover via email-based user matching in AshAuthentication, with vulnerable and fixed handler simulations.
Proof of Concept for CVE-2026-49757 — a critical vulnerability in AshAuthentication where OAuth2/OIDC callbacks resolved to local user accounts by email address instead of the (strategy, sub) identity pair, allowing unauthenticated account takeover.
| Field | Value |
|---|---|
| CVE | CVE-2026-49757 |
| CVSS 4.0 | 9.2 (Critical) |
| CWE | CWE-290 (Authentication Bypass by Spoofing) |
| GHSA | GHSA-777c-2fxx-qr28 |
| Affected | ash_authentication >= 0.1.0, < 4.14.0 and >= 5.0.0-rc.0, < 5.0.0-rc.10 |
| Patched | 4.14.0, 5.0.0-rc.10 |
No victim credentials are needed. The attacker needs only the victim's email address and an account on any OAuth provider the target accepts.
# Interactive mode (recommended)
python3 exploit.py
# Non-interactive mode (piped input)
echo | python3 exploit.py
Simulates AshAuthentication's IdentityChange.change/3 with upsert_identity: :unique_email:
[email protected] (role: admin)google-victim-real-12345)[email protected] (email_verified: false):reject Policy (default)Simulates the patched UserResolver with (strategy, sub) lookup:
keycloak-attacker-fake-789) is not found in user_identitieson_untrusted_email_match: :reject blocks the login:confirm Policytrust_email_verified? = trueemail_verified: true → auto-linking succeedsemail_verified: false → blocked| File | Description |
|---|---|
exploit.py | Main PoC script — runs all 4 phases |
vulnerable_handler.py | Simulated OAuth callback handlers (vulnerable + fixed) |
UserResolver module — resolves users by (strategy, sub) identity instead of emailon_untrusted_email_match option — :reject (default), :confirm, or :warn for unknown substrust_email_verified? option — per-provider flag, defaults true for GitHub/Google/Auth0/Slack/Apple(strategy, uid, user_id) to (strategy, uid)user_id is never updated on conflictidentity_resourceThis PoC is for educational and defensive testing purposes only. Only test against systems you own or have explicit authorization to test.