Inspect element leads to stripe account lockout authentication Bypass
After a session timeout, Stripe's web interface used a CSS class to disable buttons, but the backend authentication check for inviting an administrator was missing. An attacker with access to a logged-in but timed-out session could remove the disabled class via browser developer tools and invite themselves as an administrator without re-authenticating.
Published on jonbottarini.com
A common thing I see happening with many popular applications is that a developer will disable an HTML element through the “class” attribute. It usually looks something like this:
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.
Context
Stripe is a payments platform, and the feature involved here is the account session timeout. When you are logged into a Stripe account and stay inactive for a certain amount of time, the application times you out. From that point you are not able to make changes on the account or view other pages until you re-authenticate by entering your password. The timeout page is meant to be a hard stop: the session is still present, but the account is locked behind a re-authentication prompt.
The report is about a pattern the researcher sees in many popular applications: a developer disables an HTML element by adding a class to it rather than by removing the action on the server. The example given is a link that looks like this:
<a href="#" name="disabled_button" class="button small grey disabled">
That approach works in some situations. In others, the element can be manipulated to perform actions that an unauthenticated user should not be able to perform. That is what happened on Stripe.
Setup
The precondition is simple and is stated plainly in the report: a person has to be logged in to their Stripe account and leave their computer out in the open. The attacker then works from that already-authenticated browser session, which has reached the inactivity timeout. No special tooling is named beyond the browser's inspect element feature, and no versions or endpoints are given.
Finding it
The researcher's starting observation is the class-based disabling pattern shown above. Because the disabled state lives in the class attribute of the markup, it is a client-side control only. Anyone who can open inspect element can delete the disable class tag and view other pages, which lets them send requests from the timed-out session.
On the Stripe timeout page this matters because the page is supposed to prevent exactly that: no changes and no viewing of other pages until the password is entered again. If the only thing standing between the locked session and the rest of the application is a class on an element, the lockout is cosmetic.
Exploitation
Step 1: reach the timeout state
Log in to a Stripe account and let it time out through inactivity. The account is now locked: changes are blocked and other pages cannot be viewed until the password is re-entered.
Step 2: remove the disabled class through inspect element
Open inspect element on the timeout page and delete the disable class tag from the element. This makes the page allow navigation to other sections that the timeout page was hiding.
Step 3: navigate to the invite user section
With the class removed, navigate to the "invite user" section of the timeout page. The researcher is then able to invite himself as an administrator on the account that is timed out, without authenticating first. The video below shows the lockout and this sequence.
Root cause
The mistake is treating a client-side class as an access control. The disabled state of the element is expressed only in markup, so removing the class in the browser re-enables the navigation and the requests behind it. The server is the place where the authentication check has to happen, and Stripe confirmed that this is how it normally works: dismissing the entire modal is not enough to bypass the authentication check, because the check is made at the backend. In this situation, however, that backend check was accidentally removed, which is what allowed another administrator to be invited.
Stripe said the backend check was accidentally removed in this situation, which allowed another administrator to be invited. The report also notes an inconsistency that makes the gap stand out: Stripe made sure a malicious user could not change the web hooks, but inviting an administrator to the account was completely allowed.
Impact
An attacker with access to a logged-in but timed-out Stripe session can invite himself as an administrator on that account without re-authenticating. In the researcher's words, the method renders the entire lockout process completely useless on a Stripe.com account. The condition is significant and the report states it: the person must first be logged in to their Stripe account and leave their computer out in the open.
Fix
Stripe security was very responsive and the issue was fixed shortly after it was reported. The report does not describe the change itself.
Variants to test
A positive result is that removing the class in inspect element lets you reach the form and submit it successfully. A positive result is a successful state change without re-authentication, which shows the backend check is missing rather than just the UI control. A positive result is any action that succeeds where a neighbouring one is correctly rejected, which points to an inconsistent check. A positive result is that the underlying request still succeeds when the modal is removed.
What happened, in plain words
Stripe is a service that businesses use to take payments online. When you log in to a Stripe account and then walk away from your computer for a while, Stripe logs you out of the active part of the site. It does not throw you out completely: it shows a page that says, in effect, "you have been inactive, type your password again to continue". Until you do that, the site is supposed to stop you from changing anything or looking at other pages.
The researcher found that this lock could be undone from inside the browser. The page was hiding the locked-away parts by putting a label on certain buttons and links that made them look and behave as "disabled". That label lives in the page's own code, which the browser lets anyone inspect and edit. By deleting the label, the researcher could reach a section of the site that lets you invite a new user, and invite himself as an administrator of the account, all without typing the password again.
Stripe fixed it quickly and paid a 500 US dollar bounty. The interesting part for a beginner is not the trick itself, which is simple, but the lesson behind it: hiding something in the browser is not the same as protecting it on the server.
Background: what Stripe is and what a session timeout does
Stripe is a payments platform. Companies use it to charge customers, manage their money and administer their accounts. An account can have several people working in it, which is why there is a feature to invite other users and give them a role, such as administrator.
When you log in to a website, the site needs a way to remember that you are you on every following page. It does this with a session: after you enter your password, the server gives your browser a small piece of data (often stored in a cookie, a little note the browser attaches to every request it sends to that site). The server recognises that note and treats the request as coming from a logged-in person. You can think of it like a wristband at an event: you show your ticket once at the door, get the wristband, and after that the staff just glance at your wrist.
A session timeout is a safety feature. If you leave your desk, the wristband should stop working after a while, so that nobody who walks past your screen can keep using your account. Stripe's version of this is a lockout page: the session still exists, but the account is frozen behind a prompt asking for your password again. The report describes it as a hard stop: no changes, no viewing other pages, until you re-authenticate.
Re-authenticating simply means proving who you are a second time, here by typing your password again.
The pattern: disabling things with a class
The researcher starts with something he sees in many popular applications. A developer wants a button or link to be unusable, so instead of removing the action on the server, they add a class to the HTML element.
HTML is the language web pages are written in. Each button, link or box on a page is an element, and elements can carry a class attribute: a label (or several labels separated by spaces) that the page's styling and scripts can react to. A class called disabled is a common convention meaning "this thing is not available right now".
The example given in the report looks like this:
<a href="#" name="disabled_button" class="button small grey disabled">
Line by line, in plain words:
<a ...>is the start of a link element.astands for anchor, the HTML tag used for hyperlinks.href="#"is where the link would take you.#means "nowhere in particular", the top of the current page. It is a placeholder.name="disabled_button"is just a name given to this element so it can be referred to. It does not enforce anything by itself.class="button small grey disabled"is the important part. It attaches four labels to the element:button(style it like a button),small(make it small),grey(colour it grey, so it looks unavailable) anddisabled(treat it as disabled).- The element is not closed in the snippet, but in a real page there would be link text and a closing
</a>.
Why does this work, and why is it dangerous? Because all of those labels are instructions to the browser about how to draw and behave. They are not instructions to the server. The browser is on the visitor's computer, and the visitor is in charge of it. Anyone can open the browser's developer tools, find that element and delete the word disabled from the class list. The button turns back into a normal, clickable button. The report puts it directly: this works in some situations, but in others the element can be manipulated to perform actions that an unauthenticated user should not be able to perform. That is what happened on Stripe.
Setting up the test
The precondition is stated plainly in the report and it is worth being honest about it: a person has to be logged in to their Stripe account and leave their computer out in the open. The attacker then works from that already-logged-in browser, which has reached the inactivity timeout. No special tools are named beyond the browser's inspect element feature, and no versions or web addresses are given.
Inspect element is a built-in feature of every modern browser. You right-click something on a page and choose something like "Inspect" or "Inspect Element", and a panel opens showing the page's HTML. In that panel you can edit the HTML live: change text, delete attributes, remove elements. The change is only in your own browser window; it does not touch the website's files on the server. That distinction is the whole story here.
Finding it
The starting observation is the class-based disabling pattern above. Because the disabled state lives in the class attribute of the page's markup, it is a client-side control: it exists only on the visitor's side (the client is the browser; the server is the computer the website runs on). Anyone who can open inspect element can delete the disable class and view other pages, which lets them send requests from the timed-out session.
A request is what your browser sends to a server when you do something: load a page, submit a form, click a button that saves data. Each request carries the session cookie described earlier, which is how the server knows who is asking. If the browser can be coaxed into sending a request, the server will receive it, and the only question that matters is whether the server checks permissions before acting on it.
On the Stripe timeout page this matters because the page is supposed to prevent exactly that: no changes and no viewing of other pages until the password is entered again. If the only thing standing between the locked session and the rest of the application is a class on an element, the lockout is cosmetic: it looks like a lock, but it is paint on a door that is not actually bolted.
Exploitation, step by step
Step 1: reach the timeout state
Log in to a Stripe account and let it time out through inactivity. The account is now locked: changes are blocked and other pages cannot be viewed until the password is re-entered. This step is just setup. The researcher needs a real, timed-out session so that he can test what that state actually prevents.
Step 2: remove the disabled class through inspect element
Open inspect element on the timeout page and delete the disable class tag from the element. This makes the page allow navigation to other sections that the timeout page was hiding. Nothing is sent to the server in this step; it is purely editing what the browser shows and permits locally. The reason to do it is to see whether the page's restrictions are enforced anywhere other than in the page itself.
Step 3: navigate to the invite user section
With the class removed, navigate to the "invite user" section of the timeout page. The researcher is then able to invite himself as an administrator on the account that is timed out, without authenticating first. In other words, the form that adds a new administrator to the account accepted his submission even though the account was supposed to be frozen pending a password.
The video below shows the lockout and this sequence: the account is locked out because of inactivity, and then, by navigating to the invite user section of the timeout page through inspect element, the researcher invites himself as an administrator on the timed-out account without authenticating first.
Why it worked
The mistake is treating a client-side class as an access control. Access control is the part of a system that decides who is allowed to do what. It has to live somewhere the visitor cannot edit, which means the server. The disabled state of the element was expressed only in markup, so removing the class in the browser re-enabled the navigation and the requests behind it.
Stripe confirmed how it is supposed to work: dismissing the entire modal is not enough to bypass the authentication check, because the check is made at the backend. A modal is the pop-up style box that appears over the page, in this case the password prompt. The backend (or server side) is the code running on Stripe's computers, out of reach of your browser. Normally, even if you made the modal disappear, the server would still refuse the request. In this situation, however, that backend check was accidentally removed, which is what allowed another administrator to be invited.
So there were two layers, and both failed. The client-side class could be edited by anyone, and the backend check that should have caught the request was missing.
The report also notes an inconsistency that makes the gap stand out: Stripe made sure a malicious user could not change the web hooks, but inviting an administrator to the account was completely allowed. Web hooks are automatic notifications a service sends to another system when something happens, and they are sensitive because they can redirect where account events go. The point is that one sensitive action was properly protected during the timeout while a neighbouring one was not, which suggests the protection was applied action by action rather than uniformly.
Impact
An attacker with access to a logged-in but timed-out Stripe session can invite himself as an administrator on that account without re-authenticating. In the researcher's words, the method renders the entire lockout process completely useless on a Stripe.com account. Being an administrator means holding a high level of control over the account.
The condition is significant and the report states it: the person must first be logged in to their Stripe account and leave their computer out in the open. The report states the condition: the person must first be logged in to their Stripe account and leave their computer out in the open.
The fix
Stripe security was very responsive and the issue was fixed shortly after it was reported. The report does not describe the change itself. That is the durable kind of fix: it does not depend on the browser behaving, because the decision is made where the visitor cannot reach.
Variants to test
Each one is a way of asking the same question: is the restriction real, or is it only drawn on the page?
A positive result is that removing the class in inspect element lets you reach the form and submit it successfully. A positive result is a successful state change without re-authentication, which shows the backend check is missing rather than just the UI control. A request tool is simply software that sends requests to a server without a browser in the way, so you can see what the server does when the page is not involved. A positive result is any action that succeeds where a neighbouring one is correctly rejected, which points to an inconsistent check. A positive result is that the underlying request still succeeds when the modal is removed.
Glossary
- Access control: the part of a system that decides who is allowed to do what; it must be enforced on the server.
- Administrator: a user role with the highest level of control over an account, including managing other users.
- Backend (server side): the code running on the website's own computers, which visitors cannot edit.
- Bounty: a reward a company pays to someone who reports a security problem to it.
- Class (HTML class attribute): a label attached to a page element that styling and scripts can react to; it is only a hint to the browser.
- Client side: everything happening in the visitor's browser, on the visitor's own computer.
- Cookie: a small piece of data a site stores in your browser and your browser sends back with each request, often used to recognise a logged-in session.
- Cosmetic (control): a restriction that only changes what you see, without actually preventing the action.
- Element: a single item in a web page, such as a link, button or box, written in HTML.
- HTML: the language web pages are written in.
- Inspect element: a built-in browser tool that shows the page's HTML and lets you edit it live in your own browser.
- Modal: a box that appears over the page, such as a password prompt, which you interact with before continuing.
- Re-authenticate: prove who you are again, here by entering your password a second time.
- Request: a message your browser sends to a server, for example to load a page or submit a form.
- Session: the server's memory of you being logged in, kept alive by a cookie.
- Session timeout: an automatic lockout after a period of inactivity, meant to stop others using your open account.
- Unauthenticated: not proven to be a logged-in user.
- Web hooks: automatic notifications a service sends to another system when events happen; sensitive because they can redirect where account events go.