Skip to content
Account takeover Write-up Intermediate

You’ve Got (a Reset) Mail: A Security Analysis of Email-Based Password Reset Procedures

This paper measures how 366 popular websites implement email-based password reset and finds that 72% violate at least one OWASP guideline. Weaknesses such as reusable or long-lived tokens, missing notifications, host header injection and login CSRF could let an attacker poison reset emails or take over accounts.

Tommaso Innocenti Follow

Published on innotommy.com

You’ve Got (a Reset) Mail: A Security Analysis of Email-Based Password Reset Procedures Tommaso Innocenti1 , Seyed Ali Mirheidari2 , Amin Kharraz4 , Bruno Crispo2,3 , and Engin Kirda1 1 Northeastern University 360 Huntington Ave, Boston, MA 02115, United States {innocenti.t,e.kirda}@northeastern.edu 2 University of…

Tommaso Innocenti (@innotommy), Ali Mirheidari, Amin Kharraz (@amin_kharaz), Bruno Crispo, Engin Kirda, on innotommy.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 15 min read.

Context

This is a measurement study of email-based password reset procedures across popular websites, not a single-target bug report. The authors (Tommaso Innocenti, Seyed Ali Mirheidari, Amin Kharraz, Bruno Crispo and Engin Kirda) set out to answer three questions: how websites implement account recovery, how prevalent recovery problems are, and what the immediate threats of misconfigured recovery processes are. The feature under study is the standard "forgot password" flow: a user submits an email address, the site generates a reset token, stores it, embeds it in a reset link and emails that link to the user, who then clicks it, chooses a new password and has the token invalidated.

The reference point for the analysis is the OWASP Forgot Password Cheat Sheet, which the authors describe as the main publicly available guidance and which, in their reading, focuses on general requirements without specifics on how to implement or assess the procedure. The paper divides the process into two parts: initiating the reset request (consistent messages and constant reply time for existing and non-existing accounts, CAPTCHA or rate limiting, input validation and SQL injection prevention, token stored in a database and included in the link, reset email sent) and responding to it (password confirmed twice under a consistent policy, token invalidated, password stored with a proper hashing function, confirmation email that does not contain the new password, redirect to the normal login rather than automatic login, and the option to close open sessions or automatic invalidation).

Two attack scenarios are derived from those guidelines. Header injection: the attacker sends a poisoned reset request and manipulates the host field in the network headers, so a server without proper sanitisation builds the reset link from the poisoned field and sends a poisoned reset mail to the victim, who only needs to be known by email address. Because the mail is generated by the site's own server it bypasses spam filters, and because the reset link is usually hidden behind a button the victim is easily misled into clicking it. Login CSRF: an attacker requests a reset link for their own account and sends it to a victim; if the application validates the token and immediately sets an authorisation cookie, the victim interacts with the site while authenticated as the attacker, and everything the victim does in that account (search history, exchanged messages, saved personal or financial information such as credit card numbers) is later visible to the attacker.

Setup

The corpus was drawn from the Alexa Top 5,000: 900 websites, split into three groups by popularity (popular, medium popular, low popular). Accounts could only be created on 513 of them, because some had no public login page, required pre-approval such as bank account information, required a specific class of data such as a local phone number or a Social Security Number, or never delivered the confirmation link. A further 147 sites were removed as duplicates: institutions such as Google Inc. had several ccTLD sites whose reset link redirected to the main domain (requests on google.es or google.it went to google.com), so measuring them would have counted the same implementation twice. The final seed is 366 websites.

The data collection infrastructure is coordinated by an experiment coordinator that takes the filtered domains and drives three components: a test harness, a reset link monitor and a header manipulation proxy. The test harness reproduces user interaction with a Python script based on the Selenium Chrome web driver, using CSS selectors to find the login element and issue the reset request, with a visual check that the browsing session works. The header manipulation proxy intercepts the generated requests and injects markers into two header types, the Host header and non-standard headers, so the monitor can later pinpoint a poisoned reset mail. The reset link monitor watches the mailboxes of the created accounts, scans received mail with regular expressions and HTML body inspection to extract every link, checks for the injected markers, and filters links with a keyword heuristic to keep reset links and discard the rest.

CAPTCHAs shaped the method: 44 sites used CAPTCHA services on the login page and 90 required an explicit CAPTCHA verification before initiating the reset request, so those were run manually. The authors state their collection infrastructure will be made open source.

Eight tests were defined against the OWASP benchmark:

Test Property measured Procedure
Reset link validity window (TW) Whether a link is still valid after 24 hours Request a fresh link, store it 24 hours, then use it
Multi-use reset links (TU) Whether a link can be used more than once Use one link to reset twice in succession; success on the second means TU(s) > 1
No password change confirmation (TC) Whether the site emails a confirmation after a reset Reset, then wait up to 1 hour for the confirmation mail; none means TC(s) = false
No session invalidation (TI) Whether existing sessions survive a reset Authenticate in one browser, reset from a separate unauthenticated instance, check whether the first session is still authenticated, with up to 60 seconds of manual interaction
Insecure reset link (TS) Whether the link uses HTTPS Check the scheme of the link
Multiple valid reset links (TN) Whether several links are simultaneously valid Request two links, use the first; success means TN(s) > 1
HTTP header injection (TH) Whether injected header values are reflected Intercept the request, inject unique markers into headers, scan the reset mail for them
Login CSRF (TL) Whether a reset logs the user in automatically Reset, then manually check whether the session lands authenticated without entering the new password

The header injection test injected markers into Host, Origin, Referer, X-Host, X-Forwarded-Host, X-Forwarded-For, X-ForwardedServer, Proxy-Host, Destination, True-Client-IP, Client-IP, X-Client-IP, X-Real-IP, X-Originating-IP, CF-Connecting-IP, X-Original-URL, X-HTTP-DestinationURL, XArbitrary, X-Forwarded-Proto, Proxy, Contact, From, Forwarded, X-Wap-Profile and Profile. A marker found in the mail makes the site conditionally vulnerable, flagged for later manual confirmation.

The authors describe their results as a lower bound. Sites requiring SSNs, corporate email addresses or credit card details were excluded; the crawler tested only fifteen popular HTTP headers, so other headers may still be exploitable; and some sites blocked the test accounts after a number of reset attempts, at which point testing stopped even though those implementations might still be vulnerable.

Ethically, the authors kept reset requests to a minimum, never injected malicious code into traffic and never tried to access accounts outside their control. They did not publicly disclose vulnerable sites and contacted them directly. Contacts came from an open-source vulnerability disclosure and bug bounty program database (disclose.io), which yielded contact information for 62 vulnerable sites; sites using a broker such as HackerOne or Bugcrowd were contacted through the platform's process; for the remaining 200 sites the WhoisXML API was used to find the contact associated with the registered domain. A custom email per site was sent from a verified mail account with the authors' contact information and a way to verify their identity, including the weakness found and a link to the OWASP guidelines. Of the contacted sites, 38 (14.5%) acknowledged. Email contact performed worse than brokers: 19 replies out of 243 sites, of which 8 reported the issue to their dev team, 8 marked the report as informative and 3 fixed it. All 19 sites contacted through a broker replied, 8 marking the report as duplicated, some duplicates dated as far back as 2014, which the authors read as a missing fix. A known video streaming site confirmed it would fix the issue; the remaining sites acknowledged it but, because of restricted bug bounty program scope, marked the report informative without information about future fixes.

Finding it

The starting observation is structural: password recovery is critical but under-specified, with OWASP as the main guidance and no concrete implementation standard, so the authors used OWASP adherence as the metric. The motivating examples show what that looks like in practice. On springer.com, a well-known scientific publisher, reset tokens do not expire, against the OWASP recommendation of single-use tokens, and users get no notification about recovery requests, so unauthorised attempts go unnoticed. Seattlenews.com, a popular news site in the US Northwest, and rakuten.co.jp, a Japanese shopping site, showed similar account recovery problems. These are popular sites with significant traffic, which is why the authors argue the issues matter.

Recovery type was established by performing a reset request on each selected site, which also filtered out sites without a recovery mechanism and multi-domain sites. The result confirms earlier findings that email dominates:

Recovery type Channel Sites
Text message SMS 5 (1.4%)
Original password Email 7 (1.9%)
One-time security code Email 27 (7.4%)
Temporary password Email 25 (6.8%)
Password reset link Email 302 (82.5%)
Total 366 (100%)

Email-based recovery accounts for 361 sites, 98.6% of the whole, with only five sites using SMS as the primary method. Because 302 sites (82.5%) used the reset link, the security checks concentrated on the token: four of the six implementation checks verify the token, the remaining two verify behaviour after the reset (no session termination, no change notification).

Exploitation

The weaknesses found across all 366 sites are summarised as follows:

Weakness All sites
No change notification (NCN) 163 (44.5%)
Multiple valid tokens (MVT) 147 (40.2%)
No session termination (NST) 139 (38.0%)
Login CSRF (LC) 82 (22.4%)
No expiration (NE) 75 (20.5%)
Insecure reset link (IRL) 52 (14.2%)
Multi-use token (MUT) 21 (5.7%)
Header manipulation (HM) 6 (2.0%)
Total with at least one weakness 262 (71.6%)

Combining the table with the co-occurrence data, 57.7% of sites (211 of 366) misimplemented a security check on the reset token, and 54.0% (198 of 366) mishandled active sessions after a reset or omitted the confirmation email. Only 13% of the websites followed the OWASP guidelines. The 75 sites with no expiration had a validity window longer than 24 hours, and the authors were able to use those reset links after 24 hours. In 21 sites the generated token could be used multiple times.

Step 1: Header injection through the Host header

The proxy replaced the Host header in reset requests with a specific marker, in two separate account reset requests. The crawler then inspected every reset email and link for the marker. Three of 366 sites (1.0%) were vulnerable: the generated reset link pointed to the injected domain name. No change was detected in the email body, so Host manipulation affected only the link. An attacker who can do this steals the reset token and compromises the account.

Acceptance and rejection split as follows. Only 66 of 366 sites (18%) accepted reset requests with a manipulated Host header and sent the email, and only 3 of those were vulnerable. Of the rest, 96 sites handled the request properly and redirected to custom error pages, 70 returned different 400 error codes (mostly 403 Not Found), and 8 returned 500 Internal Server Error. The authors note that middle HTTP components such as load balancers and web application firewalls plausibly blocked the manipulated requests before they reached the server, which is another reason the figure is a lower bound: the server can still be vulnerable while an intermediary hides it.

Step 2: Header injection through non-standard headers

The proxy then added fifteen standard and non-standard headers to the reset requests. Three of 366 sites (1.0%) were vulnerable, while 198 of 366 (54%) accepted the poisoned request, a lower bounce rate than Host poisoning, which the authors attribute to Host attacks being older and better documented. Two of the three vulnerable sites used the X-Forwarded-Host value to build the reset link, which again lets an attacker steal the token and take over the account. The third site was vulnerable through x-originating-ip while being vulnerable to neither Host nor X-Forwarded-Host: the marker injected in that field was echoed in the email contents, so arbitrary phishing content could be injected into the reset email.

A separate observation was made on anonymous.com, whose reset email included not only the reset link but also the requester's IP address, taken from the x-originating-ip header. When the authors populated x-originating-ip with their marker, that value appeared in the email. They suggest some middle network component or server finds the requester's IP and appends it to the header without overwriting the value already set, so the server reads the first x-originating-ip value, the one the attacker supplied. The conclusion is that non-standard header manipulation is an effective variation of header manipulation, targeting the reset process either by poisoning the link or by manipulating the email content.

Step 3: Login CSRF

After completing a reset, the authors manually inspected the landing page to see whether the browser session was authenticated; an authenticated landing page tagged the site as vulnerable. 82 of 366 sites (22.4%) were vulnerable. The scenario is a variation of login CSRF (auth-CSRF), first introduced in 2009: the attacker forces the victim to log in to the attacker's account by sending a forged authentication request with the attacker's credentials through the victim's browser. Here the forged request is the attacker's own reset link, and the site's automatic login after the reset does the rest.

Step 4: Distribution across popularity and category

By Alexa ranking, the share of affected sites is 97% (198 sites) in the most popular group, 97.7% (87 sites) in the second and 87.7% (64 sites) in the least popular. A Mann-Whitney U test with a p-value of 0.01 could not reject the null hypothesis that all three buckets belong to the same distribution, so the authors conclude that websites are affected regardless of ranking and popularity. By category, every category has at least 60% vulnerable sites and six categories have at least 89%; token weaknesses have a higher incidence than web vulnerabilities.

The co-occurrence matrix shows three clusters: multiple valid tokens, no change notification and no session termination. Sites that fail one check are more likely to fail others, so a single misimplementation can endanger the procedure, and sites with several weaknesses allow chaining that considerably increases severity.

Root cause

The underlying cause is the absence of a standard for account recovery. OWASP gives general requirements, and the measurements show they are only partially deployed: 13% adherence. Concretely, the failures are design and implementation choices: tokens that never expire or stay valid beyond 24 hours, tokens accepted more than once, older links not invalidated when a new one is issued (the authors never observed a site refusing to issue a new link while prior links were valid), no confirmation email after a change, sessions left open after a reset, reset links served over HTTP, servers that build the reset link from the Host header or from headers such as X-Forwarded-Host or x-originating-ip without sanitisation, and applications that set an authorisation cookie straight after a valid reset link and redirect to the dashboard, assuming that only the legitimate user could hold the link. That last assumption is the root of the login CSRF exposure. Intermediaries such as load balancers and web application firewalls blocked many manipulated requests, which limits exposure but does not fix the server-side handling.

Impact

Across the corpus, 72% of websites had at least one implementation weakness, and the authors stress that this is a lower bound. The concrete consequences they demonstrate are reset link poisoning, where an attacker who knows only the victim's email address causes the site's own server to send a mail whose link points to an attacker-controlled origin, bypassing spam filters and stealing the token for account takeover; content injection into the reset email for phishing; and login CSRF, where a victim who follows an attacker's reset link ends up authenticated as the attacker, letting the attacker observe the victim's interactions with the site and any personal or financial information the victim saves in that account. Weak token handling (no expiry, reuse, multiple simultaneous valid links) widens the window for abusing a stolen link, and missing notifications or session termination removes the signals and the containment a user would otherwise have. The authors are careful to say that these weaknesses may not always result in blatant vulnerabilities, but they are indicators that developers are failing to follow robust practices.

Fix

No single site's fix is described; the paper reports that 3 of the 19 sites contacted by email fixed the reported issue and that a known video streaming site confirmed it would fix it. The direction the authors argue for is adherence to the OWASP guidelines as measured here: single-use tokens with an appropriate validity window, invalidation of older links when a new one is issued, HTTPS reset links, a confirmation email after a successful change that does not contain the new password, closing or invalidating active sessions after a reset, redirecting to the normal login instead of logging the user in automatically, consistent responses and timing for existing and non-existing accounts, CAPTCHA or rate limiting, and validation and sanitisation of input including HTTP headers so that reset links and email content are never built from attacker-controlled header values. More broadly, they call for a concrete implementation standard for account recovery, since OWASP alone is only partially deployed.

Variants to test

  1. Host header poisoning: send a reset request with the Host header set to a domain you control. A positive result is a reset email whose link points to your domain, with the email body unchanged.
  2. Non-standard header poisoning: repeat the request injecting markers into X-Forwarded-Host, X-Host, X-Forwarded-Server, X-Original-URL and similar headers. A positive result is a reset link built from the injected value.
  3. Email content injection: inject a marker into headers such as x-originating-ip and inspect the email body. A positive result is the marker echoed in the message, which allows phishing content to be placed in a mail the site itself sends.
  4. Token expiry: request a link, wait beyond 24 hours, then use it. A positive result is a successful reset, meaning the validity window is too long.
  5. Token reuse: use one link to reset twice. A positive result is the second reset succeeding, meaning the token is not invalidated on first use.
  6. Multiple simultaneous links: request two links and use the first. A positive result is the first link still working after the second was issued.
  7. Login CSRF: reset an account you control from a clean browser and observe the landing page. A positive result is an authenticated session without entering the new password.
  8. Session termination: authenticate in one browser, reset from another, then interact with the first session for up to 60 seconds. A positive result is the first session still authenticated.
  9. Change notification: reset an account and watch the mailbox for an hour. A positive result for the weakness is no confirmation email arriving.
  10. Insecure link: check the scheme of the reset link. A positive result is an http:// link, which lets a man-in-the-middle intercept the new password.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 25 min read.

What happened, in plain words

Almost every website that lets you create an account also has a "forgot password" button. You type your email address, the site sends you an email with a special link, you click it, you choose a new password, and you are back in. This is called the password reset or account recovery process, and it is one of the most security-sensitive parts of any website: if it is built carelessly, someone else can end up inside your account.

This study looked at that process on hundreds of popular websites. The authors are Tommaso Innocenti, Seyed Ali Mirheidari, Amin Kharraz, Bruno Crispo and Engin Kirda. They did not attack one company. They registered accounts on many sites, triggered the "forgot password" flow on each one, and measured how well each site followed the published security advice. They asked three questions: how do websites implement account recovery, how common are the problems, and what can an attacker actually do when the process is misconfigured.

The short answer they found: problems are everywhere. 72% of the websites they could measure had at least one weakness in the reset process, and only 13% followed the published guidance fully. Some of those weaknesses let an attacker take over an account, or trick a victim into using an account the attacker controls.

A few concepts appear constantly below, so here they are up front.

  • A token is a long random string a website generates for you, like a temporary ticket. In a password reset, the token is placed inside the link that is emailed to you. Whoever holds the link holds the token, and the token is what proves to the site that the person resetting the password is the person who owns the email address.
  • A cookie is a small piece of data your browser stores for a website and sends back with every request. Sites use cookies to remember that you are logged in. If an attacker can make your browser hold their login cookie, the site thinks you are them.
  • A header is a line of extra information that travels with every web request and response, alongside the actual content. Your browser sends headers describing what it wants and where it is going; the server sends headers back describing what it is returning. Some headers are standard and well known; others are custom and only some servers look at them.
  • CSRF (Cross-Site Request Forgery) is a class of attack where a malicious party makes your browser perform an action on a site where you are logged in, without you intending it. Login CSRF is a specific flavour: instead of acting as you, the attacker makes your browser log in as them.
  • OWASP is a non-profit organisation that publishes free, widely used security guidance for developers. Their "Forgot Password Cheat Sheet" is the main public document describing how a password reset should be built.

The feature under study

The standard "forgot password" flow has two halves.

  1. Starting the reset. You submit your email address. The site checks the input, generates a reset token, stores it in its database, builds a reset link containing the token, and emails that link to you.
  2. Completing the reset. You click the link. The site checks the token, lets you type a new password twice, stores the new password safely, invalidates the token, and emails you a confirmation.

The reference point for the whole study is the OWASP Forgot Password Cheat Sheet. The authors describe it as the main publicly available guidance, and they note that in their reading it focuses on general requirements without saying exactly how to implement or assess the procedure. That gap matters: if there is no precise standard, every site invents its own version, and some versions are unsafe.

What OWASP recommends, as summarised in the paper:

  • When someone submits an email address, reply with the same message and take the same amount of time whether or not an account exists. Otherwise an attacker can use the reset form to discover which email addresses are registered (this is called user enumeration), and can also measure response times to learn the same thing (a timing side channel).
  • Protect the form against automated abuse with a CAPTCHA (a puzzle that is easy for a human and hard for a bot) or rate limiting (refusing too many requests in a short period).
  • Validate the input and protect the database against SQL injection, a technique where an attacker slips database commands into a form field so the site runs them.
  • Store the token in a database, put it in the link, and email the link.
  • On the reset page, ask for the new password twice, under the same password rules as the rest of the site.
  • Invalidate the token after use, and store the new password with a proper hashing function (a one-way scrambling function, so that even someone who steals the database cannot read the passwords).
  • Send a confirmation email after the change, and do not put the new password in it.
  • After the reset, send the user to the normal login page rather than logging them in automatically. Automatic login complicates session handling and can introduce CSRF problems.
  • Offer to close the account's other open sessions, or close them automatically.

The two attacks the authors focus on

From those guidelines, the authors derive two concrete attack scenarios. Both are worth understanding before the numbers, because the numbers are counts of how often each one worked.

Header injection

When your browser asks a site for a page, it includes a Host header saying which site it wants. Servers often use that header to build links, for example to know whether to write https://example.com/reset?token=... or some other address. If a server builds the reset link from whatever the Host header says, without checking it, an attacker can send a reset request for a victim's email address but claim to be a different domain. The server then emails the victim a link that points at the attacker's domain, with the victim's real token inside it. When the victim clicks, the token goes to the attacker.

The attacker only needs to know the victim's email address. And because the email is genuinely sent by the real website's server, it passes spam filters. The link is usually hidden behind a button in the email, so the victim has little reason to suspect anything.

Login CSRF

Some sites, after a valid reset link is used, immediately log the user in and send them to their dashboard. The reasoning is that only the account owner could have the link. That reasoning is wrong. An attacker can request a reset link for their own account and send that link to a victim, perhaps claiming it is something else. If the victim clicks it and completes the reset, the site logs the victim in, but as the attacker's account. Everything the victim then does in that session, such as searches, messages, or saved personal and financial details like credit card numbers, is stored in the attacker's account, and the attacker can read it later.

How the study was set up

The authors started from the Alexa Top 5,000, a public ranking of popular websites, and picked 900 of them. They split those into three groups by popularity: popular, medium popular and low popular. Splitting by popularity lets them check whether big, well-resourced sites do better than smaller ones.

They could only create accounts on 513 of the 900. The rest were excluded for practical reasons:

  • some had no public login page;
  • some required pre-approval, such as bank account information;
  • some demanded a specific kind of data, such as a local phone number or a Social Security Number;
  • in some cases the confirmation email never arrived.

They then removed 147 more sites as duplicates. Large organisations such as Google Inc. run many country-specific domains, and the reset link on, say, google.es or google.it simply redirects to google.com. Measuring those separately would count the same implementation several times. After removing them, 366 websites remained, and that is the corpus for every number in this article.

The tooling

An experiment coordinator took the filtered list of domains and drove three components.

  1. The test harness. This is the part that behaves like a person using a browser. It is a Python script built on the Selenium Chrome web driver, a tool that lets a program control a real Chrome browser. It uses CSS selectors, the same mechanism a web page uses to style elements, to find the login box on each page and submit the reset request. The authors also did a visual check to confirm the automated browsing session actually worked.
  2. The header manipulation proxy. A proxy sits between the browser and the website and can inspect and alter traffic passing through. This one intercepts the reset request the harness generated and inserts unique markers into two kinds of header: the Host header and various non-standard headers. A marker is just a distinctive string the authors chose, so that later they can search the emails for it and know whether the site copied the header value into the message.
  3. The reset link monitor. This watches the mailboxes of the accounts the authors created. It scans each incoming email, using regular expressions (patterns for matching text) and inspection of the HTML body, to pull out every link in the message. It then checks those links for the injected markers, and filters them with a keyword heuristic, meaning a simple rule based on words, to keep the password reset links and throw the rest away.

CAPTCHAs shaped the method. 44 sites used CAPTCHA services on their login page, and 90 required an explicit CAPTCHA check before starting the reset. Automation cannot solve those, so the authors ran those cases by hand. They also say their data collection infrastructure will be released as open source.

The eight tests

Using OWASP as the benchmark, the authors defined eight tests. Each one is a small experiment with a clear pass or fail.

Test What it checks How it was run
Reset link validity window (TW) Is a link still usable after 24 hours? Request a fresh link, keep it for 24 hours, then try to use it
Multi-use reset links (TU) Can one link be used more than once? Use a link to reset twice in a row; if the second works, the link is reusable
No password change confirmation (TC) Does the site email you after a reset? Reset, then wait up to 1 hour for the confirmation email; none means fail
No session invalidation (TI) Do already-open sessions survive a reset? Log in in one browser, reset from a separate logged-out browser, then check whether the first session is still logged in, interacting with it for up to 60 seconds
Insecure reset link (TS) Does the link use HTTPS? Look at the start of the link
Multiple valid reset links (TN) Can several links be valid at once? Request two links, use the first; if it works, several are valid
HTTP header injection (TH) Do injected header values end up in the email? Intercept the request, inject markers into headers, search the reset email for them
Login CSRF (TL) Does a reset log you in automatically? Reset, then check by hand whether the browser ends up logged in without typing the new password

A note on the 24-hour choice: OWASP only says the validity window should be "appropriate", so the authors picked 24 hours as a reasonable balance between security and usability. A link that expires too fast is annoying for real users; one that lives too long gives an attacker more time to abuse a stolen link.

For the header injection test, the markers went into this set of headers: Host, Origin, Referer, X-Host, X-Forwarded-Host, X-Forwarded-For, X-ForwardedServer, Proxy-Host, Destination, True-Client-IP, Client-IP, X-Client-IP, X-Real-IP, X-Originating-IP, CF-Connecting-IP, X-Original-URL, X-HTTP-DestinationURL, XArbitrary, X-Forwarded-Proto, Proxy, Contact, From, Forwarded, X-Wap-Profile and Profile. If a marker turned up in the email, the site was marked as conditionally vulnerable and flagged for a human to confirm.

What the results do not cover

The authors are explicit that their numbers are a lower bound, meaning the true amount of weakness is at least this large, possibly larger. Three reasons:

  • Sites requiring Social Security Numbers, corporate email addresses or credit card details were excluded entirely.
  • The crawler only tested fifteen popular HTTP headers, so a server could still be vulnerable through some other header nobody tried.
  • Some sites blocked the test accounts after a number of reset attempts, and testing stopped there, even though those sites might still be vulnerable.

How the sites were contacted

The authors took care not to cause harm. They kept reset requests to a minimum, never injected malicious code into traffic, and never tried to access accounts outside their control. They did not publish a list of vulnerable sites. Instead they contacted each site directly.

Contacts came from three sources:

  1. An open-source vulnerability disclosure and bug bounty program database (disclose.io), which gave contact details for 62 vulnerable sites. A bug bounty program is a scheme where a company invites outsiders to report security problems, often paying for valid reports.
  2. Sites that use a broker such as HackerOne or Bugcrowd, which are platforms that run such programmes; those were contacted through the platform's own process.
  3. For the remaining 200 sites, the WhoisXML API was used to find the contact associated with the registered domain. Whois is the public directory that records who registered a domain name.

Each site got a custom email from a verified mail account, including the authors' contact details and a way to verify their identity, a description of the weakness found, and a link to the OWASP guidelines used to measure it.

Of all the sites contacted, 38 (14.5%) acknowledged the report. Email did worse than brokers: 19 replies out of 243 sites contacted by email, of which 8 passed the issue to their development team, 8 marked the report as informative (meaning they did not treat it as a security issue), and 3 fixed it. All 19 sites contacted through a broker replied, and 8 marked the report as a duplicate. Some of those duplicates were dated as far back as 2014, which the authors read as a sign the site had known about the problem for years without fixing it. A well-known video streaming site confirmed it would fix the issue. The remaining sites acknowledged the report but, because of the restricted scope of their bug bounty programme, marked it informative without saying anything about future fixes.

Finding it

The starting point is structural. Password recovery is critical, but under-specified. OWASP is the main guidance, and there is no concrete implementation standard, so the authors used adherence to OWASP as their measuring stick.

Three examples show what the problem looks like in practice:

  • On springer.com, a well-known scientific publisher, reset tokens do not expire. OWASP recommends single-use tokens to limit the risk of account takeover. Users also get no notification about recovery requests, so an unauthorised attempt goes unnoticed.
  • Seattlenews.com, a popular news site in the US Northwest, and rakuten.co.jp, a Japanese shopping site, showed similar account recovery problems.

These are popular sites with large audiences, which is why the authors argue the issue matters beyond obscure corners of the web.

To find out which recovery method each site uses, the authors simply performed a reset request on every selected site. That step also filtered out sites with no recovery mechanism at all and sites spread across multiple domains. The result confirms earlier research that email dominates:

Recovery type Channel Sites
Text message SMS 5 (1.4%)
Original password Email 7 (1.9%)
One-time security code Email 27 (7.4%)
Temporary password Email 25 (6.8%)
Password reset link Email 302 (82.5%)
Total 366 (100%)

Email-based recovery covers 361 sites, 98.6% of the whole, with only five sites using SMS as the primary method. Because 302 sites (82.5%) used a reset link, the security checks concentrated on the token inside that link. Four of the six implementation checks verify the token; the other two verify what happens after the reset, namely whether sessions are closed and whether a confirmation email is sent.

Exploitation

Here is the headline table. Each row is a weakness, and the number is how many of the 366 sites had it.

Weakness All sites
No change notification (NCN) 163 (44.5%)
Multiple valid tokens (MVT) 147 (40.2%)
No session termination (NST) 139 (38.0%)
Login CSRF (LC) 82 (22.4%)
No expiration (NE) 75 (20.5%)
Insecure reset link (IRL) 52 (14.2%)
Multi-use token (MUT) 21 (5.7%)
Header manipulation (HM) 6 (2.0%)
Total with at least one weakness 262 (71.6%)

Read the rows in plain terms:

  • No change notification: the site never tells you your password was changed, so you would not notice an attacker doing it.
  • Multiple valid tokens: the site keeps several reset links alive at once, so each new request creates another chance for a link to leak.
  • No session termination: after a reset, sessions that were already logged in stay logged in, so an attacker who was already inside stays inside.
  • Login CSRF: the site logs you in automatically after a reset, which enables the trick described earlier.
  • No expiration: the link still works after 24 hours.
  • Insecure reset link: the link uses plain HTTP rather than HTTPS, so it can be intercepted in transit.
  • Multi-use token: the same link can be used more than once.
  • Header manipulation: the site builds the link or the email content from header values it should not trust.

Combining this table with the co-occurrence data, 57.7% of sites (211 of 366) got a security check on the reset token wrong, and 54.0% (198 of 366) mishandled active sessions after a reset or skipped the confirmation email. Only 13% of the websites followed the OWASP guidelines. The 75 sites with no expiration had a validity window longer than 24 hours, and the authors were able to use those reset links after 24 hours had passed. On 21 sites the generated token could be used multiple times.

Step 1: Header injection through the Host header

The proxy replaced the Host header in reset requests with a specific marker, in two separate reset requests. The crawler then inspected every reset email and every link inside it for that marker. Three of 366 sites (1.0%) were vulnerable: the generated reset link pointed at the injected domain name. No change was detected in the email body, so Host manipulation affected only the link. An attacker who can do this steals the reset token and compromises the account.

Acceptance and rejection split like this:

  • Only 66 of 366 sites (18%) accepted reset requests with a manipulated Host header and sent the email at all, and only 3 of those were vulnerable.
  • 96 sites handled the request properly and redirected the crawler to custom error pages.
  • 70 sites returned various 400-family error codes (the paper says "mostly 403 Not Found").
  • 8 sites returned 500 Internal Server Error.

The authors note that middle HTTP components, such as load balancers (machines that spread incoming traffic across several servers) and web application firewalls (devices that inspect traffic and block suspicious requests), plausibly blocked the manipulated requests before they reached the server. That is another reason the figure is a lower bound: the server itself can still be vulnerable while an intermediary hides it from view.

Step 2: Header injection through non-standard headers

The proxy then added fifteen standard and non-standard headers to the reset requests. Three of 366 sites (1.0%) were vulnerable, while 198 of 366 (54%) accepted the poisoned request. That is a much lower bounce rate than with Host poisoning, which the authors attribute to Host attacks being older and better documented, so more sites have defences against them.

Two of the three vulnerable sites used the X-Forwarded-Host value to build the reset link. X-Forwarded-Host is a custom header that proxies sometimes add to record the original hostname a request came in for; a server that trusts it without checking can be fooled the same way as with Host. Again, an attacker can steal the token and take over the account.

The third site was vulnerable through x-originating-ip while being vulnerable to neither Host nor X-Forwarded-Host. x-originating-ip is another custom header, meant to carry the original client's IP address through proxies. Here the marker injected in that field was echoed in the email contents, so arbitrary phishing content could be placed inside the reset email.

A separate observation was made on anonymous.com, whose reset email included not only the reset link but also the requester's IP address, taken from the x-originating-ip header. When the authors filled x-originating-ip with their marker, that value appeared in the email. They suggest some middle network component or server finds the requester's IP and appends it to the header without overwriting the value already set, so the server reads the first x-originating-ip value, the one the attacker supplied. The conclusion is that non-standard header manipulation is an effective variation of header manipulation, targeting the reset process either by poisoning the link or by manipulating the email content.

Step 3: Login CSRF

After completing a reset, the authors manually inspected the landing page to see whether the browser session was logged in. If the landing page was an authenticated one, the site was tagged as vulnerable. 82 of 366 sites (22.4%) were vulnerable.

The scenario is a variation of login CSRF, also called auth-CSRF, first introduced in 2009. In the classic form, the attacker forces the victim to log in to the attacker's account by sending a forged authentication request carrying the attacker's credentials through the victim's browser. Here the forged request is the attacker's own reset link, and the site's automatic login after the reset does the rest.

Step 4: Distribution across popularity and category

By Alexa ranking, the share of affected sites is 97% (198 sites) in the most popular group, 97.7% (87 sites) in the second, and 87.7% (64 sites) in the least popular. The authors ran a Mann-Whitney U test, a statistical test for whether two groups differ, with a p-value of 0.01. A p-value is the probability of seeing a result like this by chance if there were really no difference; 0.01 is a strict threshold. They could not reject the null hypothesis that all three buckets come from the same distribution, so they conclude that websites are affected regardless of ranking and popularity.

By category, every category has at least 60% vulnerable sites, and six categories have at least 89%. Token weaknesses have a higher incidence than web vulnerabilities.

The co-occurrence matrix, a grid showing how often pairs of weaknesses appear on the same site, shows three clusters: multiple valid tokens, no change notification and no session termination. Sites that fail one check are more likely to fail others, so a single misimplementation can endanger the whole procedure, and sites with several weaknesses allow chaining, where one weakness makes another worse, considerably increasing severity.

Root cause

The underlying cause is the absence of a standard for account recovery. OWASP gives general requirements, and the measurements show they are only partially deployed: 13% adherence. Concretely, the failures are design and implementation choices:

  • tokens that never expire, or stay valid beyond 24 hours;
  • tokens accepted more than once;
  • older links not invalidated when a new one is issued (the authors never observed a site refusing to issue a new link while prior links were still valid);
  • no confirmation email after a change;
  • sessions left open after a reset;
  • reset links served over plain HTTP;
  • servers that build the reset link from the Host header, or from headers such as X-Forwarded-Host or x-originating-ip, without sanitisation;
  • applications that set an authorisation cookie straight after a valid reset link and redirect to the dashboard, assuming that only the legitimate user could hold the link.

That last assumption is the root of the login CSRF exposure. Intermediaries such as load balancers and web application firewalls blocked many manipulated requests, which limits exposure but does not fix the server-side handling.

Impact

Across the corpus, 72% of websites had at least one implementation weakness, and the authors stress this is a lower bound. The concrete consequences they demonstrate are:

  • Reset link poisoning. An attacker who knows only the victim's email address causes the site's own server to send a mail whose link points at an attacker-controlled origin. The mail bypasses spam filters, and the attacker gets the token, which means account takeover.
  • Content injection into the reset email. The attacker can put their own text or links into a mail the site itself sends, which is ideal for phishing.
  • Login CSRF. A victim who follows an attacker's reset link ends up logged in as the attacker, letting the attacker observe the victim's interactions with the site and any personal or financial information the victim saves in that account.

Weak token handling, meaning no expiry, reuse, or several simultaneous valid links, widens the window for abusing a stolen link. Missing notifications or session termination removes the signals and the containment a user would otherwise have. The authors are careful to say that these weaknesses may not always result in blatant vulnerabilities, but they are indicators that developers are failing to follow robust practices.

Fix

No single site's fix is described. The paper reports that 3 of the 19 sites contacted by email fixed the reported issue, and that a well-known video streaming site confirmed it would fix it.

The direction the authors argue for is adherence to the OWASP guidelines as measured here:

  • single-use tokens with an appropriate validity window;
  • invalidation of older links when a new one is issued;
  • HTTPS reset links;
  • a confirmation email after a successful change that does not contain the new password;
  • closing or invalidating active sessions after a reset;
  • redirecting to the normal login instead of logging the user in automatically;
  • consistent responses and timing for existing and non-existing accounts;
  • CAPTCHA or rate limiting;
  • validation and sanitisation of input, including HTTP headers, so that reset links and email content are never built from attacker-controlled header values.

More broadly, they call for a concrete implementation standard for account recovery, since OWASP alone is only partially deployed.

Variants to test

If you want to check a site you are allowed to test, these are the same experiments the authors ran, in plain steps. Each one states what a positive result looks like.

  1. Host header poisoning. Send a reset request with the Host header set to a domain you control. A positive result is a reset email whose link points at your domain, with the email body unchanged.
  2. Non-standard header poisoning. Repeat the request, injecting markers into X-Forwarded-Host, X-Host, X-Forwarded-Server, X-Original-URL and similar headers. A positive result is a reset link built from the injected value.
  3. Email content injection. Inject a marker into headers such as x-originating-ip and inspect the email body. A positive result is the marker echoed in the message, which allows phishing content to be placed in a mail the site itself sends.
  4. Token expiry. Request a link, wait beyond 24 hours, then use it. A positive result is a successful reset, meaning the validity window is too long.
  5. Token reuse. Use one link to reset twice. A positive result is the second reset succeeding, meaning the token is not invalidated on first use.
  6. Multiple simultaneous links. Request two links and use the first. A positive result is the first link still working after the second was issued.
  7. Login CSRF. Reset an account you control from a clean browser and watch the landing page. A positive result is a logged-in session without entering the new password.
  8. Session termination. Log in in one browser, reset from another, then interact with the first session for up to 60 seconds. A positive result is the first session still logged in.
  9. Change notification. Reset an account and watch the mailbox for an hour. A positive result for the weakness is no confirmation email arriving.
  10. Insecure link. Check the start of the reset link. A positive result is an http:// link, which lets a man-in-the-middle intercept the new password.

Glossary

  • Account recovery: the set of steps a user follows to get back into an account they have lost access to, most often by resetting the password.
  • Alexa Top 5,000: a public ranking of the most popular websites, used here to pick the sites to study.
  • Auth-CSRF: another name for login CSRF.
  • Bug bounty programme: a scheme where a company invites outsiders to report security problems, often paying for valid reports.
  • CAPTCHA: a puzzle that is easy for a human and hard for a bot, used to slow down automated abuse.
  • Cookie: a small piece of data a browser stores for a website and sends back with each request, commonly used to remember that you are logged in.
  • Co-occurrence matrix: a grid showing how often two weaknesses appear on the same site.
  • CSRF (Cross-Site Request Forgery): an attack where a malicious party makes your browser perform an action on a site where you are logged in, without you intending it.
  • CSS selector: a pattern used to pick out elements on a web page, normally for styling; here used to find the login box.
  • Header: a line of extra information sent with a web request or response, alongside the actual content.
  • Hashing function: a one-way scrambling function, so that stored passwords cannot be read back even if the database is stolen.
  • Header injection: making a server build a link or message from a header value the attacker controls.
  • Host header: the standard header in a web request that says which site the browser wants.
  • HTTPS: the encrypted version of HTTP, so traffic cannot be read or altered in transit.
  • Load balancer: a machine that spreads incoming traffic across several servers.
  • Login CSRF: a CSRF variant where the attacker makes your browser log in as them.
  • Lower bound: a minimum figure; the true amount is at least this large, possibly larger.
  • Mann-Whitney U test: a statistical test for whether two groups differ.
  • Marker: a distinctive string inserted into a request so it can be searched for later.
  • Null hypothesis: the default assumption in a statistical test that there is no difference between groups.
  • OWASP: a non-profit organisation that publishes free security guidance for developers, including the Forgot Password Cheat Sheet.
  • p-value: the probability of seeing a result like this by chance if there were really no difference.
  • Phishing: tricking someone into clicking a link or entering details by pretending to be a trusted party.
  • Proxy: a component that sits between a browser and a website and can inspect and alter traffic passing through.
  • Rate limiting: refusing too many requests in a short period, to slow down automated abuse.
  • Regular expression: a pattern for matching text, used here to pull links out of emails.
  • Reset link: the URL emailed to a user that contains the reset token.
  • Reset token: a long random string generated by a site that proves the holder is allowed to reset a password.
  • Selenium Chrome web driver: a tool that lets a program control a real Chrome browser.
  • Session: the period during which a site remembers you as logged in, usually via a cookie.
  • SQL injection: slipping database commands into a form field so the site runs them.
  • Timing side channel: learning secret information by measuring how long a system takes to respond.
  • Token: a temporary secret string, like a ticket, used to prove something to a site.
  • User enumeration: discovering which email addresses are registered on a site, often by comparing responses.
  • Web application firewall: a device that inspects traffic and blocks suspicious requests.
  • Whois: the public directory that records who registered a domain name.
  • X-Forwarded-Host: a custom header that proxies sometimes add to record the original hostname a request came in for.
  • x-originating-ip: a custom header meant to carry the original client's IP address through proxies.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.