Skip to content
CSRF Disclosed report Beginner

Leaking CSRF token over HTTP resulting in CSRF protection bypass

A subscription form on the Coinbase site sent its POST request over plain HTTP with the user's CSRF token in the body. An attacker positioned on the network could read that token and then use it to forge requests on behalf of the logged-in user, defeating the site's CSRF protection.

anshuman_bh Follow

Originally disclosed on HackerOne

Bounty$1,000 View original
  • Triaged in 18 days
  • Fixed in 3 months
  • Paid in 3 months
  • Disclosed after 4 months
  1. Start a proxy tool like Burp.
  2. Authenticate to the Coinbase application.
  3. Navigate to the URL https://coinbase.com/docs/api/overview
  4. Under Developer Updates, enter your email address and click "Subscribe".
  5. Notice that this request is sent over HTTP with the CSRF token in the body of the POST request.

This means that an attacker can easily perform a MiTM attack and gain access to this CSRF token. The attacker can then trick this authenticated Coinbase user to perform CSRF attacks since the attacker now knows the CSRF token associated with this user. This results in bypassing the existing CSRF protection in the Coinbase application.

Attachments

Screen_Shot_2014-06-07_at_12.41.02_AM.png
Screen_Shot_2014-06-07_at_12.41.02_AM.png From the original on HackerOne

The original report as published on HackerOne, by anshuman_bh. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

The target is the Coinbase web application, and the feature in question is the email subscription form on the API documentation page. Following the report's steps, the request carrying the CSRF token was seen to travel over plain HTTP.

The reproduction steps are short and entirely manual:

  1. Start a proxy tool like Burp.
  2. Authenticate to the Coinbase application.
  3. Navigate to the URL https://coinbase.com/docs/api/overview
  4. Under Developer Updates, enter your email address and click "Subscribe".
  5. Notice that this request is sent over HTTP with the CSRF token in the body of the POST request.

The key observation is in step 5: the subscription POST is issued over HTTP rather than HTTPS, and the CSRF token sits in the request body. The report includes a single screenshot as an attachment.

Screen_Shot_2014-06-07_at_12.41.02_AM.png
Screen_Shot_2014-06-07_at_12.41.02_AM.png From the original on HackerOne

The report was disclosed on 16 October 2014 and carried a bounty of 1000.00 USD. It does not state a severity rating, a CVSS score or a fix.

Root cause

The subscription POST was sent over HTTP, so the body, including the CSRF token, crossed the network in cleartext. A CSRF token only protects a session if an attacker cannot learn it; sending it over an unencrypted channel removes that property.

Impact

As the report puts it, an attacker who can intercept traffic can easily perform a man-in-the-middle attack and gain access to the CSRF token. With that token in hand, the attacker can then trick the authenticated user into performing CSRF attacks, because the attacker now knows the token associated with that user. The net effect described is a bypass of the existing CSRF protection in the Coinbase application.

The attack requires a position on the network path between the user and the site, and the user must be authenticated and trigger the subscription request.

How this kind of bug works

CSRF defences rest on a secret the attacker cannot read: a synchroniser token stored in the session and echoed in a form field or header, or a double-submit cookie, or an origin check. The token is what distinguishes a request generated by the site's own pages from one forged by a third-party page. If the token leaks, the defence collapses, because the attacker can embed the stolen value in a forged request and the server will accept it as legitimate.

Leakage happens whenever the token is exposed to someone other than the browser and server: sent over HTTP, placed in a URL that ends up in logs, referrer headers or browser history, written into a page that is cached by a shared proxy, or returned by an endpoint that reflects it to other users. The transport case is the simplest: anything in an HTTP request or response body is readable by anyone who can observe the connection, such as an attacker on the same wireless network, a compromised router, or a proxy the victim trusts.

Defences are straightforward. Serve the whole application, including every form action and every API endpoint, over HTTPS only, with HSTS so the browser refuses to downgrade. Never submit a form from an HTTPS page to an HTTP URL. Keep tokens out of URLs and out of anything that gets logged or cached. On the server side, validate the token on every state-changing request and reject requests whose Origin or Referer does not match.

How to test for it

  1. Map every state-changing form and API call in the application while authenticated, using a proxy that records the full request.
  2. For each one, note the scheme of the request URL and of the page that hosts the form. A form on an HTTPS page posting to an HTTP action is the signal to chase.
  3. Look at where the CSRF token travels: body, query string, custom header. A token in the query string is worth flagging even over HTTPS, because URLs leak into logs and referrers.
  4. Check whether the site sets HSTS and whether HTTP requests are redirected to HTTPS before any body is sent. A redirect after the body has already gone over the wire does not help.
  5. Confirm the token is actually required: replay the state-changing request with the token removed or altered and see whether the server rejects it. If it accepts the request without a valid token, the CSRF protection is absent rather than merely leaky, which is a separate and stronger finding.

A positive result looks like a state-changing request whose token is observable on the wire, combined with proof that the server enforces that token. Common false positives: the request is HTTP but the token is not actually validated, so the real bug is missing CSRF protection; the HTTP endpoint is a redirect that never processes the body; the token is bound to the session and single-use, limiting replay; or the action is not security-relevant.

How it is fixed

Redirect all HTTP traffic to HTTPS at the edge before any application logic runs, and enable HSTS with a long max-age so browsers never attempt plain HTTP again. Change every form action and API base URL to HTTPS. Audit templates for hard-coded http:// links. Keep CSRF tokens in POST bodies or headers only, never in URLs, and mark authenticated pages as non-cacheable. As defence in depth, validate Origin and Referer on state-changing requests so a stolen token alone is not sufficient.

Hunting notes

This class hides at the edges of an application: documentation sites, marketing pages, newsletter and subscription forms, legacy subdomains, and endpoints that were migrated to HTTPS later than the main app. Mixed content is a strong recon signal: load the main pages and watch for any form action or fetch to an http:// URL. Certificate transparency and subdomain enumeration surface older hosts that may still speak HTTP. Proxy history is the best tool: filter for requests whose URL scheme is http while the session cookie is present.

Without the second half, a reviewer may treat it as a transport hygiene issue rather than a CSRF bypass. Keep the proof minimal and reproducible, and state the precondition, namely that the attacker must be positioned to intercept traffic.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What happened, in plain words

Coinbase is a website where people buy, sell and store cryptocurrency. Like most sites with user accounts, it has a feature that lets you subscribe to email updates: on the API documentation page there is a small form where you type your email address and click "Subscribe". Following the report's steps, the request carrying a security token was seen to travel over plain HTTP instead of the encrypted HTTPS.

To follow this, you need a few everyday ideas. When you fill in a form and click a button, your browser sends a request to the server: a message that says what you want to do and carries the data you typed. If the address of that request starts with https://, the message is encrypted, like a sealed envelope that only the server can open. If it starts with http://, it is sent in the clear, like a postcard that anyone handling it along the way can read.

A cookie is a small piece of data the site stores in your browser after you log in, so the site can recognise you on the next request. A CSRF token (Cross-Site Request Forgery token) is a secret value the site puts into its forms. When the form is submitted, the server checks that the token matches the one it gave you. The point is that another website cannot guess this secret, so it cannot forge a request that the server will accept as coming from you. Think of it as a numbered cloakroom ticket: the server only hands your coat back if you present the ticket it issued to you.

The researcher's steps were short and entirely manual:

  1. Start a proxy tool like Burp.
  2. Authenticate to the Coinbase application.
  3. Navigate to the URL https://coinbase.com/docs/api/overview
  4. Under Developer Updates, enter your email address and click "Subscribe".
  5. Notice that this request is sent over HTTP with the CSRF token in the body of the POST request.

Step 1 matters because a proxy is a tool that sits between your browser and the website and records every request and response. Without it you cannot see what your browser actually sends. Step 3 and step 4 take you to the subscription form and trigger the request. Step 5 is the finding: the subscription request went out over HTTP, and the token was inside the body of the request, the part that carries the data you submitted.

The report includes one screenshot as an attachment.

Screen_Shot_2014-06-07_at_12.41.02_AM.png
Screen_Shot_2014-06-07_at_12.41.02_AM.png From the original on HackerOne

Because the request was sent in the clear, anyone who can observe the connection between the user and Coinbase can read the token. The report describes this as a man-in-the-middle attack: an attacker positioned on the network path can intercept the message. With the token in hand, the attacker can then trick the logged-in user into performing actions the attacker chooses, because the server will see the correct token and accept the request. The report calls the result a bypass of the existing CSRF protection in the Coinbase application.

The report was disclosed on 16 October 2014 and carried a bounty of 1000.00 USD. It does not state a severity rating, a CVSS score or a fix.

In general, how this kind of bug works

CSRF protection rests on a secret that an attacker cannot read. The server gives your browser a token, your browser sends it back with each form submission, and the server checks it. If the token leaks, the protection collapses: the attacker can put the stolen value into a forged request and the server will treat it as legitimate.

Leakage happens whenever the token is exposed to someone other than your browser and the server. Sending it over HTTP is the simplest case: anything in an HTTP request or response can be read by anyone who can observe the connection. Tokens can also leak through URLs that end up in logs, browser history or referrer headers, or through pages cached by a shared proxy.

The defences are straightforward. Serve the whole application over HTTPS only, including every form action and every API endpoint, and use HSTS so the browser refuses to fall back to HTTP. Never submit a form from an HTTPS page to an HTTP URL. Keep tokens out of URLs and out of anything that gets logged or cached. On the server side, validate the token on every request that changes something, and reject requests whose Origin or Referer does not match.

In general, how to test for it

  1. Map every form and API call that changes something while you are logged in, using a proxy that records the full request.
  2. For each one, note whether the request URL and the page hosting the form use HTTPS or HTTP. A form on an HTTPS page posting to an HTTP address is the signal to chase.
  3. Look at where the CSRF token travels: body, query string or custom header. A token in the query string is worth flagging even over HTTPS, because URLs leak into logs and referrers.
  4. Check whether the site sets HSTS and whether HTTP requests are redirected to HTTPS before any body is sent. A redirect after the body has already gone over the wire does not help.
  5. Confirm the token is actually required: replay the request with the token removed or altered and see whether the server rejects it. If the server accepts the request without a valid token, the CSRF protection is absent rather than merely leaky, which is a separate and stronger finding.

A positive result looks like a request that changes something, whose token is observable on the wire, combined with proof that the server enforces that token. Common false positives: the request is HTTP but the token is not actually validated, so the real bug is missing CSRF protection; the HTTP endpoint is a redirect that never processes the body; the token is bound to the session and single-use, limiting replay; or the action is not security-relevant.

In general, how it is fixed

Redirect all HTTP traffic to HTTPS at the edge before any application logic runs, and enable HSTS with a long max-age so browsers never attempt plain HTTP again. Change every form action and API base URL to HTTPS. Audit templates for hard-coded http:// links. Keep CSRF tokens in POST bodies or headers only, never in URLs, and mark authenticated pages as non-cacheable. As defence in depth, validate Origin and Referer on requests that change something, so a stolen token alone is not sufficient.

Glossary

  • CSRF (Cross-Site Request Forgery): an attack where a malicious site makes your browser send a request to another site where you are logged in, without your intent.
  • CSRF token: a secret value placed in forms and checked by the server, so that requests forged by other sites are rejected.
  • HTTP: the protocol browsers and servers use to exchange requests and responses; plain HTTP is not encrypted.
  • HTTPS: HTTP wrapped in encryption, so observers on the network cannot read the messages.
  • Request: the message your browser sends to a server when you load a page or submit a form.
  • Response: the message the server sends back.
  • POST request: a request that carries data in its body, typically used when submitting a form.
  • Body: the part of a request that carries the data you submitted.
  • Cookie: a small piece of data stored by your browser so the site can recognise your session.
  • Session: the logged-in state that ties your requests together.
  • Proxy: a tool that sits between your browser and the site and records the traffic, such as Burp.
  • Man-in-the-middle (MiTM) attack: an attack where someone positioned on the network path between you and the site intercepts or alters the traffic.
  • Bypass: getting around a protection that is supposed to stop you.
  • HSTS: a header that tells the browser to use HTTPS only for a site.
  • Origin / Referer: headers that tell the server where a request came from.
  • Bounty: a reward paid by a company for a security report.
  • Severity / CVSS: a rating of how serious a vulnerability is; the report does not state one.

More by anshuman_bh

View all

18 more disclosed reports, best first.

More from Coinbase

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.