CSRF on "Set as primary" option on the accounts page
The 'set as primary' account action was performed through a GET request with no CSRF token, unlike the delete action which had one. An attacker who knew a victim's account number could craft a link that, when visited by a logged-in user, silently changed which account was primary.
Originally disclosed on HackerOne
- Fixed in 55 days
- Paid in 55 days
- Disclosed after 3 months
On navigating to the Accounts page, a Coinbase user can create multiple accounts. The user can then make any of these accounts as their primary account. There are also other options of renaming and deleting these accounts.
Although there is a CSRF token being sent as a POST parameter for the delete operation, there is no such CSRF token for the "set as primary" operation. Infact, this request is a GET request. Similar CSRF controls should be implemented for the "Set as primary" operation as well.
Also, the account number/id is not something that is trivial for an attacker to predict. But, since it is sent as a GET request, it gets cached in the browser history, proxies, logs, etc. So, once the attacker gets hold of such an account number of a legitimate coinbase user, he can exploit a CSRF attack by framing a URL which looks as simple as this:
https://coinbase.com/accounts/<account_number>/set_as_primary
The attacker can then trick the legitimate user to switch his primary account without the user's intention.
Please see the screenshot attached which shows that a GET request was sent requesting to switch the primary account. All that is required for it to be successfully processed is the session cookie.
Attachments

Context
Coinbase lets a user hold more than one account under a single login. On the Accounts page a user can create additional accounts, rename them, delete them, and mark any one of them as the primary account. The primary account is the one the site treats as the user's main account.
The report looks at how that page performs the "set as primary" action and compares it with the neighbouring delete action.
Setup
No special tooling, roles or versions are described. The precondition is simply a logged-in Coinbase user with more than one account on the Accounts page, which is what makes the "set as primary" option available at all.
Finding it
While going through the Accounts page, the researcher compared the requests behind the different account operations. Two things stood out:
- The delete operation sends a CSRF token as a POST parameter.
- The "set as primary" operation sends no CSRF token at all, and it is issued as a GET request.
That asymmetry is the signal. If one state-changing operation on the same page is protected by a token, the sibling operation that changes which account is primary should be protected the same way. A GET request for a state change is worse still, because the URL ends up in browser history, proxy logs and server logs.
The researcher also noted that the account number/id is not trivial for an attacker to predict. That limits blind guessing, but it does not remove the problem, because the identifier leaks through exactly the channels a GET request feeds: history, proxies and logs.
Exploitation
Step 1: obtain a legitimate user's account number
The attacker needs the account number of one of the victim's accounts. Because the "set as primary" action is a GET request, the URL containing that number is cached in the browser history, in proxies and in logs. Once the attacker gets hold of such an account number belonging to a legitimate Coinbase user, the rest is straightforward.
Step 2: build the CSRF URL
The attacker frames a URL that looks as simple as this:
https://coinbase.com/accounts/<account_number>/set_as_primary
The path carries the target account number and the action name. There is no token parameter and no POST body, so nothing in the request has to be forged beyond the victim's ambient session.
Step 3: make the victim's browser send it
The attacker tricks the legitimate user into loading that URL. The victim's browser attaches the session cookie automatically. As the researcher puts it, all that is required for the request to be successfully processed is the session cookie.
The screenshot attached to the report shows a GET request being sent to switch the primary account.

Result
The victim's primary account is switched without their intention.
Root cause
The "set as primary" operation is implemented as a GET request with no anti-CSRF token. The existing defence on the same page, a CSRF token sent as a POST parameter for the delete operation, was simply not applied to this sibling action. Because the action is reachable by a plain GET and requires only the session cookie, a crafted URL can trigger it. The unpredictability of the account number is not a CSRF defence: it only raises the bar for an attacker who has not yet seen the identifier, and the GET design is precisely what leaks the identifier into history, proxies and logs.
Impact
An attacker who knows an account number belonging to a legitimate Coinbase user can cause that user's primary account to change, provided the user is logged in and can be induced to load the crafted URL. The change happens against the user's intention. The report does not describe any further consequence of the switch beyond the change itself.
Fix
The report asks for the same CSRF controls used on the delete operation to be implemented for the "set as primary" operation as well. The report does not state what was actually changed.
Variants to test
- Sibling actions on the same page. Enumerate every state-changing operation next to a protected one (rename, delete, set default, enable/disable) and check whether each carries the same token. A positive result is one action that succeeds with the token removed or with a cross-site GET.
- GET-based state changes. Look for actions expressed as
/<object>/<id>/<verb>paths. A positive result is the action completing from a cross-site navigation with only the session cookie present. - Identifier leakage. Check whether object identifiers appear in URLs that end up in history, referrer headers or logs. A positive result is an identifier recoverable from a channel the attacker can observe.
- Token present but unenforced. Where a token is sent, try removing it, sending an empty value, or reusing a token from another session. A positive result is the action succeeding anyway.
Hunting notes
This class of bug hides in feature-rich settings pages where several operations sit side by side and were written at different times: one gets a token, its neighbour does not. During recon, map every request the page fires when you click through the options and compare their methods and parameters; a GET among POSTs, or a POST without a token among POSTs with one, is the signal. The report's impact argument rests on two points a triage team can check quickly: the action changes account state, and the only thing standing between an attacker and that change is the victim's session cookie. The account number's unpredictability was acknowledged and argued around rather than ignored, which is what makes the case for the fix.
What happened, in plain words
Inside a Coinbase login, a user can have more than one account, a bit like having several bank accounts under one online banking login. There is a page called the Accounts page where you can create extra accounts, give them new names, delete them, and choose which one is your "primary" account. The primary account is the one the site treats as your main account.
This report is about a weakness in how that page handles the "set as primary" action. The researcher found that one neighbouring action, deleting an account, was protected against a common attack called CSRF. The "set as primary" action was not protected at all, and worse, it was triggered by simply visiting a web address (a GET request). That means a page controlled by an attacker could quietly switch a logged-in user's primary account without the user asking for it.
Before going further, two everyday ideas help.
- A cookie is a small piece of data your browser stores for a website and sends back with every request to that site. After you log in, the site gives your browser a session cookie, which is like a wristband at an event: showing it proves you are already inside, so you do not have to log in again on every page.
- A CSRF token is a second, secret value that a well-behaved page includes in requests that change something. The server checks it before acting. It is like a bank teller asking for your signature on a withdrawal slip: even if someone has your wristband, they cannot complete the withdrawal without the signature.
CSRF stands for Cross-Site Request Forgery. The name sounds technical, but the idea is simple: your browser automatically attaches your cookies to requests, even requests that were triggered by a different website you happen to be visiting. An attacker abuses that automatic behaviour to make your browser send a request you never intended. The classic comparison is a forged letter with your signature already on it: the attacker does not need your password, only the fact that your browser signs everything for you.
The setup
The report does not describe any special tools, user roles or software versions. The only precondition is a logged-in Coinbase user who has more than one account on the Accounts page, because that is what makes the "set as primary" option appear at all.
Finding it
While going through the Accounts page, the researcher compared the requests that sit behind the different account operations. A request is simply the message your browser sends to a server when you click something, and the server's reply is the response. Two things stood out:
- The delete operation sends a CSRF token as a POST parameter. POST is one of the ways a browser can send a request; it carries data in the body of the message rather than in the address, and it is the usual choice for actions that change something.
- The "set as primary" operation sends no CSRF token at all, and it is issued as a GET request. GET is the ordinary way a browser asks for a page: the details travel in the address itself, which is why you can bookmark it or see it in your history.
That difference is the signal. If one action on the same page that changes your settings is protected by a token, the action next to it that changes which account is primary should be protected the same way. A GET request for a change is worse still, because the address ends up saved in browser history, in proxy logs and in server logs. A proxy is an intermediate computer that passes traffic along, often inside a company network, and it keeps records of the addresses it forwards.
The researcher also noted that the account number (the identifier of a particular account) is not easy for an attacker to guess. That makes blind guessing impractical, but it does not remove the problem, because the identifier leaks through exactly the channels a GET request feeds: history, proxies and logs.
Exploitation
Step 1: obtain a legitimate user's account number
The attacker needs the account number of one of the victim's accounts. Because the "set as primary" action is a GET request, the address containing that number is cached in the browser history, in proxies and in logs. Once the attacker gets hold of such an account number belonging to a legitimate Coinbase user, the rest is straightforward. This step is why the GET design matters so much: the very thing that makes the action easy to trigger is also what scatters the identifier into places an attacker may be able to read.
Step 2: build the CSRF URL
The attacker frames an address that looks as simple as this:
https://coinbase.com/accounts/<account_number>/set_as_primary
Line by line, in plain words:
https://coinbase.comis the site being addressed./accounts/points at the accounts area of the site.<account_number>is a placeholder for the victim's account number, the value the attacker obtained in step 1./set_as_primaryis the action name: it tells the site to make that account the primary one.
There is no token parameter and no POST body, so nothing in the request has to be forged beyond the victim's existing session. In other words, the attacker does not need to know the victim's password or copy any secret value; the address alone is enough.
Step 3: make the victim's browser send it
The attacker tricks the legitimate user into loading that address. The victim's browser attaches the session cookie automatically, because that is what browsers do for requests to a site you are logged in to. As the researcher puts it, all that is required for the request to be successfully processed is the session cookie.
The screenshot attached to the report shows a GET request being sent to switch the primary account.

Result
The victim's primary account is switched without their intention.
Root cause
The "set as primary" operation is implemented as a GET request with no anti-CSRF token. The defence that already existed on the same page, a CSRF token sent as a POST parameter for the delete operation, was simply not applied to this neighbouring action. Because the action can be reached by a plain GET and requires only the session cookie, a crafted address can trigger it. The unpredictability of the account number is not a CSRF defence: it only raises the bar for an attacker who has not yet seen the identifier, and the GET design is precisely what leaks the identifier into history, proxies and logs.
Impact
An attacker who knows an account number belonging to a legitimate Coinbase user can cause that user's primary account to change, provided the user is logged in and can be induced to load the crafted address. The change happens against the user's intention. The report does not describe any further consequence of the switch beyond the change itself.
Fix
The report asks for the same CSRF controls used on the delete operation to be implemented for the "set as primary" operation as well.
Variants to test
These are the wider lessons the researcher's approach suggests, written for anyone who wants to look for similar issues.
- Sibling actions on the same page. List every action on a settings page that changes something and sits next to a protected one (rename, delete, set default, enable or disable), then check whether each carries the same token. A positive result is one action that still succeeds when the token is removed, or that can be triggered by a GET from another site.
- GET-based state changes. Look for actions written as
/<object>/<id>/<verb>paths, where an object is a thing the site manages, an id identifies it and a verb is the action. A positive result is the action completing from a link on another site with only the session cookie present. - Identifier leakage. Check whether identifiers appear in addresses that end up in history, in the referrer header (the field that tells a site which page you came from) or in logs. A positive result is an identifier you can recover from a channel an attacker can observe.
- Token present but unenforced. Where a token is sent, try removing it, sending an empty value, or reusing a token from another session. A positive result is the action succeeding anyway.
Hunting notes
This class of bug hides in feature-rich settings pages where several operations sit side by side and were written at different times: one gets a token, its neighbour does not. During recon, meaning the early exploration of a site, map every request the page fires when you click through the options and compare their methods and parameters. A GET among POSTs, or a POST without a token among POSTs with one, is the signal. The report's impact argument rests on two points a triage team can check quickly: the action changes account state, and the only thing standing between an attacker and that change is the victim's session cookie. The account number's unpredictability was acknowledged and argued around rather than ignored, which is what makes the case for the fix.
Glossary
- API: a way for one piece of software to talk to another, usually by sending requests to specific addresses and getting structured replies.
- Account number (identifier): the value that names a particular account on the site, used in addresses to point at that account.
- Browser history: the record your browser keeps of the pages and addresses you have visited.
- Cookie: a small piece of data a website stores in your browser and receives back with each request to that site.
- CSRF (Cross-Site Request Forgery): an attack where another website makes your browser send a request to a site you are logged in to, using your existing session without your intent.
- CSRF token: a secret value included in requests that change something, which the server checks before acting, so a request forged by another site fails.
- GET request: a request that asks for something and carries its details in the address, which is why it can be bookmarked, cached and logged.
- POST request: a request that sends data in the body of the message rather than the address, typically used for actions that change something.
- Primary account: the account the site treats as the user's main one.
- Proxy: an intermediate computer that forwards traffic, often inside a company network, and keeps records of what passes through.
- Recon: the early exploration of a target to understand its pages, requests and behaviour.
- Referrer header: a field in a request that tells the destination site which page the visitor came from.
- Request: the message a browser sends to a server when you click something or load a page.
- Response: the server's reply to a request.
- Session: the state of being logged in, kept alive by a session cookie so you do not have to log in on every page.
- Session cookie: the cookie that proves you are logged in; the browser attaches it automatically to requests for that site.
- State-changing action: any action that alters data or settings, such as deleting an account or changing which one is primary.
- Triage: the process a security team uses to review a report and decide whether it is valid and how serious it is.
- URL: the address of a page or resource on the web.