Session works after logout from Shopify account
A logout request sent while a product creation request was in progress from the same session could fail, leaving the session active after logout. An attacker with access to a session could therefore keep using it after the legitimate user believed they had logged out.
Originally disclosed on HackerOne
- Triaged in 26 hours
- Fixed in 23 months
- Paid in 5 days
- Disclosed after 23 months
Summary by the program
@Cryptographer reported if a logout request for a given session was received during the time a product creation request was in progress from the same session, it was possible the logout request could fail. We determined this was the result of a race condition in how we were updating and revoking user sessions and have since fixed the issue.
Summary by the researcher
What the report shows
The target is a Shopify store at your-store.myshopify.com, and the feature involved is session handling around logout. The researcher, @Cryptographer, found that a logout request for a given session could fail if it arrived while a product creation request from the same session was still in progress.
In the researcher's own words the report body is empty, so the sequence of steps is only described in the program's summary. As the program describes it:
- A product creation request is started from a session.
- While that request is still in progress, a logout request for the same session is sent.
- The logout request can fail, leaving the session in place.
The program states that this was the result of a race condition in how user sessions were being updated and revoked, and that the issue has since been fixed. The report is rated low severity. No bounty figure is given, and the researcher's summary section contains no text.
Root cause
The program attributes the behaviour to a race condition in the code that updates and revokes user sessions. The program attributes the behaviour to a race condition in the code that updates and revokes user sessions, without describing the exact mechanism.
Impact
The report's own framing is narrow: a logout request can fail while another request from the same session is in flight. The practical consequence is that a user who logs out during that window may keep a valid session without intending to. The report does not describe an attacker model, does not show a cross-user attack, and does not claim that another party can obtain the session. It is rated low severity, which is consistent with a reliability flaw in session revocation rather than a direct account takeover.
How this kind of bug works
A race condition appears when two operations read and then write the same shared state without coordinating, and the result depends on which one finishes last. Session stores are a classic place for this: a request handler may load the session, do work, and write the session back, while a logout handler deletes or marks the session revoked. If the write-back happens after the revocation, the revocation is undone.
The bug class is often called a lost update or a check-then-act race. It is timing dependent, so it may not reproduce on every attempt, and it is more likely when one of the operations is slow, for example a request that creates a resource and touches the session on the way out.
Defences are the usual ones for shared mutable state: atomic compare-and-set on the session record, a version or generation counter that rejects stale writes, revocation flags that are checked on every request rather than relying on deletion, and serialising operations per session where the store allows it.
How to test for it
Look for features where a long-running authenticated action and a session-changing action can overlap. Product or resource creation, file uploads, imports and bulk operations are good candidates, as are logout, password change and session revocation endpoints.
- Authenticate and capture the session cookie or token.
- Identify a slow authenticated request, for example a create endpoint that does meaningful work.
- Send that request, and while it is still in flight, send the logout or revocation request for the same session.
- After both complete, replay an ordinary authenticated request with the original session value.
A positive result is that the replayed request is still accepted after the logout reported success. Repeat the sequence several times, because a race may only trigger occasionally, and vary the delay between the two requests to widen the window.
Common false positives: the client kept a cached page but the server rejected the request; the logout response was an error that was not noticed; a second session or token was still valid for an unrelated reason; or the application issues a fresh session on the next request regardless of the old one. Confirm with a server-side response, not with client state, and check that the session you replay is the same one you logged out.
How it is fixed
The program says the issue has since been fixed, without describing the fix. General defences for shared mutable session state include atomic compare-and-set, version or generation checks, revocation flags checked on every request, and serialising operations per session.
Hunting notes
This bug class tends to hide wherever one endpoint mutates a session and another endpoint revokes it, especially when the mutating endpoint is slow. Recon signals include separate logout and revoke endpoints, session identifiers that change on privilege changes, and frameworks where the session is saved at the end of a request. Multi-step flows such as checkout, onboarding and account settings are worth attention because they combine long operations with session updates.
What happened, in plain words
This report is about a Shopify store, the kind of online shop that lives at an address like your-store.myshopify.com. The feature involved is the login session: the short-lived proof that you are signed in while you browse and manage your shop.
A session is easiest to picture as a cloakroom ticket. When you log in, the server hands your browser a ticket (usually stored in a cookie, a small piece of data the browser sends back with every request). As long as you show a valid ticket, the server treats you as logged in. Logging out is meant to cancel the ticket so it can never be used again.
The researcher, @Cryptographer, found that this cancellation could fail. If a logout request for a session arrived while a product creation request from the same session was still being processed, the logout could be ignored. The session stayed valid even though the user had asked to log out.
The program's own summary describes the sequence:
- A product creation request is started from a session.
- While that request is still in progress, a logout request for the same session is sent.
- The logout request can fail, leaving the session in place.
The program explains the cause as a race condition in how user sessions were being updated and revoked, and says the issue has since been fixed. The report is rated low severity. The researcher's own summary section contains no text, so the steps above come from the program's description.
Why the timing matters
A request is simply a message your browser sends to a server asking it to do something, such as "create this product" or "log me out". Normally requests are handled one after another from your point of view, but on the server several can be in progress at once.
A race condition happens when two operations touch the same shared thing at the same time and the result depends on which one finishes last. Think of two people editing the same shared document: one deletes a paragraph while the other is still saving an older copy. The save can put the paragraph back, and the deletion is lost.
Here the shared thing is the session record. The program says the cause was a race condition in how sessions were updated and revoked, without describing the exact mechanism.
What it means in practice
The report's framing is narrow: a logout can fail while another request from the same session is still running. The practical consequence is that a user who logs out during that window may keep a valid session without meaning to. The report does not describe an attacker, does not show one user affecting another, and does not claim that someone else can obtain the session. That is consistent with the low severity rating: this is a reliability flaw in logging out, not a direct takeover of an account.
In general, how this kind of bug works
Race conditions appear wherever two operations read and then write the same shared state without coordinating. Session stores are a classic place for them, because one part of the code may load the session, do some work, and save it back, while another part deletes or marks it revoked. If the save-back happens after the revocation, the revocation is undone.
Because the bug depends on timing, it may not happen on every attempt. It is more likely when one of the two operations is slow, for example a request that creates something and touches the session on the way out.
How to test for it
Look for places where a long-running action and a session-changing action can overlap. Creating products or other resources, uploading files, imports and bulk operations are good candidates, as are logout, password change and session revocation.
- Log in and capture the session cookie or token.
- Find a slow request that requires you to be logged in, such as a create endpoint that does real work.
- Send that request, and while it is still running, send the logout request for the same session.
- After both finish, send an ordinary logged-in request using the original session value.
A positive result is that the replayed request is still accepted after the logout reported success. Repeat the sequence several times, because a race may only trigger occasionally, and vary the delay between the two requests to widen the window.
Watch for false positives: the browser showed a cached page but the server actually rejected the request; the logout response was an error nobody noticed; a second session was still valid for an unrelated reason; or the application hands out a fresh session on the next request anyway. Confirm with a server-side response, not with what the browser displays, and make sure the session you replay is the same one you logged out.
How it is fixed
The program says the issue has since been fixed, without describing the fix. General defences for shared mutable session state include atomic compare-and-set, version or generation checks, revocation flags checked on every request, and serialising updates per session.
What to include in a report
Glossary
- Session: the server-side record that says you are logged in, identified by a value your browser sends with each request.
- Cookie: a small piece of data a website stores in your browser and receives back on later requests.
- Token: a value used to prove identity or permission, often stored in a cookie or sent in a header.
- Request: a message from your browser to a server asking it to perform an action.
- Endpoint: a specific address and action on a server, such as the one that creates a product or logs you out.
- Race condition: a bug where two operations touch the same shared state at the same time and the outcome depends on which finishes last.
- Lost update: a race where one operation's change is overwritten by another operation saving an older copy.
- Revocation: cancelling a session or token so it can no longer be used.
- Atomic: done as a single indivisible step, so nothing can slip in halfway through.
- Compare-and-set: an update that only succeeds if the stored value still matches what was read, rejecting stale writes.
- Generation counter: a number that increases with each change, used to detect and reject outdated writes.
- False positive: a test result that looks like a bug but is caused by something else.
- Severity: a rating of how serious a bug is, here low.
- Account takeover: when an attacker gains control of someone else's account.