PayPal Password Leak: The $15,300 Captcha Bug
*AI-assisted: drafted with AI help from public sources, then reviewed and edited. This is an analytical case study of a public disclosure, not my own discovery.*


AI-generated illustration
PayPal’s anti-brute-force challenge replayed your login, plaintext password included, and the tokens to trigger it sat in a script file
AI-assisted: drafted with AI help from public sources, then reviewed and edited. This is an analytical case study of a public disclosure, not my own discovery.
A feature built to stop password guessing ended up handing passwords out. This PayPal password leak, reported in November 2019, let a malicious web page recover a victim’s email and plaintext password once they logged in from the same browser. PayPal paid $15,300 and shipped a fix about a day after the award.
Disclaimer: * Educational and defensive use only. PayPal fixed this in December 2019. Endpoint details, token formats and proof-of-concept code are intentionally omitted.*
Vulnerability Overview
- Type: Cross-site script inclusion (XSSI) leaking session tokens, chained with a security challenge that echoed stored credentials
- CWE: CWE-306 (Missing Authentication for Critical Function), as classified on the HackerOne report; CWE-201 (Insertion of Sensitive Information Into Sent Data) as my analytical mapping
- CVE / CVSS: No CVE; CVSS 8.0 (High), as stated by the researcher
- Bounty: $15,300
How the PayPal Password Leak Worked (high level)
In PayPal’s main login flow, Alex Birsan found a JavaScript file that carried a CSRF token and a session ID. Any website can load a script cross-origin, so values baked into it are readable by whatever page the victim is on. That is XSSI.
Alone, the tokens enabled neither CSRF nor session hijack. What mattered was where they were consumed. After a few failed logins, PayPal showed a reCAPTCHA. Solving it sent a request whose response put the user back into the login flow by re-submitting their latest attempt. That response held the email and the password in plain text.
Every input to that request was reachable: two tokens from the leaky script, one field that was never validated, and a captcha token not bound to the session, so any freshly solved captcha worked.
The chain: the attacker’s page read the tokens, fired a few junk logins from the victim’s browser to trip the challenge, and waited for the victim to sign in normally, which replaced the junk credentials with real ones. The attacker then completed the challenge server-side and read the replayed form. Birsan found the same flow on some guest checkout pages, which exposed card data too.
Business Impact
This is a payment account password, plus card numbers in checkout. PayPal’s summary notes the victim had to follow a login link from the malicious site, much like phishing. Birsan’s view: one visit to an attacker page was the only interaction needed. Either way, password reuse multiplies the damage.
Fixing PayPal Password Leak-Style Flows (my own analysis)
1. Never ship secrets inside executable JavaScript. Serve tokens as JSON behind same-origin checks. PayPal’s fix added a CSRF token that script inclusion cannot reach.
2. Bind challenge tokens to one session and one challenge. A captcha solved elsewhere must not unlock this login.
3. Do not hold a password in order to replay it. Resume a pending login by reference and ask the user to type again.
# Pseudocode: a challenge that resumes a login without ever echoing credentials
def login(req, session):
fails = counters.get(f"login:{req.email}")
if fails >= 5 and not session.challenge_passed:
pending = pending_logins.create(session_id=session.id, email=req.email, ttl=120)
return challenge_page(pending.id) # page carries no email or password
if not authenticate(req.email, req.password):
counters.incr(f"login:{req.email}") # failure is counted even though we reject
return error("invalid credentials")
return start_session(req.email)
def validate_challenge(req, session):
pending = pending_logins.get(req.pending_id)
if not pending or pending.session_id != session.id:
return error("invalid challenge") # bound to this session only
if not captcha.verify(req.captcha_token, action="login", bound_to=session.id):
return error("captcha failed")
session.challenge_passed = True
return redirect("/login") # user re-enters the password
# Test: challenge responses never contain the email or password
# Test: pending_id from another session -> rejected
# Test: a rejected login still increments the failure counter
Key Takeaways
- Anything inside a JavaScript file is effectively public to every website your users visit.
- Security controls are features too. Test their unhappy paths as hard as the login itself.
- If a flow needs to replay a password, the design is wrong. Keep references, not secrets.
Credit & Sources
Discovered and reported by Alex Birsan. Primary source: The Bug That Exposed Your PayPal Password, published 8 January 2020, with the disclosed HackerOne report #739737. Facts come from those pages; analysis and code are original.
Next breakdown: the Subaru admin panel bug that let researchers unlock cars with just a license plate. Follow @masimshahzad for daily bug bounty breakdowns.
First published by Adam Hale on Medium.
Sources
Share
Reactions
Comments
Your name and comment appear on this article for other readers.
Corrections and tips:[email protected]

