Skip to content
Access control Write-up Intermediate

The Story Of How I Bypass SSO Login

A page that required SSO login briefly showed the protected content before redirecting, and the author found that replacing the SSO login page's response with a copied 200 OK response from another path made the protected page reachable without authentication. An attacker could view content that should require SSO login.

zer0d Follow

Published on systemweakness.com

System Weakness

zer0d, on systemweakness.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. 4 min read.

Context

This is a short account of an authentication bypass found on a target listed on HackerOne. The researcher does not name the company, the product or the affected host, and the write-up contains no request or response text, only descriptions of what was done in Burp. The feature involved is an SSO login gate: a page that should only be reachable after authenticating through single sign-on. The researcher's observation is that the protected content was briefly visible before the SSO login page appeared, and that the gate could be removed by replacing the server's response.

Setup

The work was done against a target chosen on HackerOne. The tools were:

  • A bash script, subEnum, which takes the domain addresses copied from the target page and enumerates subdomains.
  • A Python script, SubChecker, which parses the resulting list and keeps the reachable subdomains.
  • Burp, used as a proxy to inspect and modify traffic.

No account, role, version or configuration detail is given. The only precondition described is that the target had at least one page behind an SSO login and at least one other reachable path on the same site returning 200 OK.

Finding it

The first step was to copy the whole set of domain addresses from the target page into a text file for the bash script. While subdomain enumeration ran, the researcher looked into the company: what it does and which technologies it uses. When the script finished, the subdomains were written to a new text file, and the Python script was run to parse which of them were reachable.

The researcher then went through the subdomains looking for anything unusual. On one page, the SSO login was required, but for about a millisecond the page behind the login was visible before the login screen appeared. That flash of protected content was the signal: the researcher treated it as a logical issue in the site and moved to Burp to examine it.

Exploitation

Step 1: change the request method

The first attempt was to alter the HTTP method on the request to the SSO-protected page, trying GET to POST, TRACE and similar. This did not work: the login gate still applied.

Step 2: borrow a known-good response

The researcher changed approach. A different path on the same website was opened, one that returned 200 OK and was reachable without authentication, and its response was copied. The response to the SSO login page request was then intercepted in Burp.

Step 3: swap the response body and forward

The copied 200 OK response was pasted over the intercepted SSO login response and forwarded. The page was then reachable, even though the researcher should not have had access. That was the bug.

The write-up does not include the actual request or response, the hostname, the path, the headers or the body used, so the exact mechanics of the swap cannot be reproduced from it.

Root cause

The report describes the issue as a logical flaw and does not analyse the server-side code. What the behaviour implies is that the access decision for the protected page was not enforced independently of what the client received. The researcher treated it as a logical issue in the site, without analysing where the gate was applied. The method-change attempt did not work.

Impact

The researcher states that the page was reachable without the access they should have needed. The report does not describe what the page contained, which users or data it exposed, or whether the finding was triaged, rewarded or fixed. The impact is therefore limited to what is shown: unauthenticated access to at least one SSO-protected page on the target.

Fix

The fix implied by the behaviour is to enforce the authorisation decision on the server for every request to the protected resource, so that the protected content is never returned to an unauthenticated client regardless of what response the client or an intermediary substitutes.

Variants to test

  • Request a protected path directly and watch for protected content appearing before the SSO redirect. A positive result is any protected markup, data or API payload arriving before the login page.
  • Replace the response to a protected request with a 200 OK response copied from an unauthenticated path on the same site. A positive result is the protected page rendering with the substituted response.
  • Try other methods (POST, TRACE, and others) against the protected path. A positive result is any method returning protected content instead of the login gate.
  • Look for the same pattern on other subdomains of the same target, since the enumeration step is what surfaced this host in the first place.

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. 11 min read.

What happened, in plain words

A security researcher was looking for bugs on a company's website through HackerOne, a platform where companies invite people to test their systems and report problems. On one of the company's pages, visitors were supposed to be sent to a single sign-on (SSO) login screen before they could see anything. SSO is a way of logging in once with one account and then being let into many different services without typing a password again, the way a building pass lets you into several rooms.

The researcher noticed something odd: for about a millisecond, the protected page appeared before the login screen took over. That tiny flash suggested something was wrong with how the login gate worked.

To test the idea, the researcher used a tool called Burp, which sits between the browser and the website and lets you read and edit the messages going back and forth. The first attempt, changing the type of request being sent, did not work. The second attempt did: the researcher copied a normal, successful response from a different, reachable page of the same site, pasted it over the response that was asking for a login, and forwarded it. The page was then reachable, even though the researcher should not have had access. That was the bug.

The write-up does not name the company, the page, or the exact messages exchanged, so the precise details cannot be reproduced from it. What follows explains each step and the ideas behind it for someone who has never done security testing before.

The setting

The target was a company listed on HackerOne. A target is simply the collection of websites and systems a company has agreed can be tested. The researcher does not say which company it was, what it does, or which of its addresses was affected.

The feature involved is an SSO login gate. Think of a gate in an office building: you show your pass at the gate, and only then can you walk into the corridor behind it. On a website, the gate is a page that should only appear after you have proved who you are through the company's single sign-on system. Everything behind the gate is meant to be private.

The researcher's key observation was that the protected content was briefly visible before the SSO login page appeared. In everyday terms, it was as if the door to the corridor opened for a split second before the security guard asked for your pass. That is a hint that something in the gate is not working as intended.

The tools

Three things were used:

  1. A bash script called subEnum. Bash is a way of giving a computer a list of commands to run in order, like a recipe. This particular script takes a list of domain addresses and finds subdomains.
  2. A Python script called SubChecker. Python is a programming language often used for small utility tasks. This script reads the list of subdomains and keeps only the ones that actually respond.
  3. Burp, a proxy. A proxy is a middleman that sits between your browser and the website. Instead of your browser talking directly to the site, it talks to Burp, and Burp passes the message on. Because Burp sees everything, you can read each message and change it before it is forwarded.

A quick word on subdomains, since the whole first phase depends on them. A domain is the main address of a site, for example example.com. A subdomain is a prefix added in front of it, such as shop.example.com or login.example.com. Large companies often have dozens or hundreds of them, and each one can be a separate application with its own quirks. Finding them all is a standard first move, because the interesting page is often not the one linked from the homepage.

No account, role, software version or configuration detail is given in the write-up. The only precondition described is that the target had at least one page behind an SSO login and at least one other reachable path on the same site that returned 200 OK.

Finding it

The first step was to copy the whole set of domain addresses from the target page into a text file for the bash script. The reason is practical: you want a complete picture of what the company runs before you start poking at individual pages. Copying addresses by hand into a file gives the script something to work from.

While the subdomain enumeration ran, the researcher looked into the company: what it does and which technologies it uses. This is background reading. Knowing whether a company is, say, a shop or a bank, and roughly what its site is built with, helps you guess where the sensitive parts are and what kind of mistakes are likely.

When the script finished, the subdomains were written to a new text file. The Python script was then run to work out which of them were reachable. A subdomain that does not answer is not worth further time, so filtering the list down to live hosts saves effort.

The researcher then went through the subdomains looking for anything unusual. This part is described as needing some instinct: there is no checklist that says "look here". On one page, the SSO login was required, but for about a millisecond the page behind the login was visible before the login screen appeared.

That flash of protected content was the signal. The researcher treated it as a logical issue in the site, meaning a mistake in how the site decides who is allowed to do what, rather than a mistake in, say, a password or a certificate. The next move was to Burp, to look at the actual messages and see whether the gate could be removed.

Exploitation

Step 1: change the request method

The first attempt was to alter the HTTP method on the request to the SSO-protected page, trying GET to POST, TRACE and similar.

A method is a word at the start of every web request that says what kind of action you want. GET means "give me this page". POST means "here is some data, please act on it", and is what a login form uses when you press submit. TRACE is an older method that asks the server to echo the request back. The idea behind trying different methods is that sometimes a site checks permissions for one kind of request but forgets to check for another, the way a building might lock the front door but leave the loading bay open.

This did not work: the login gate still applied. That is useful information in itself. It tells you the gate is not simply tied to one method, so the weakness must be somewhere else.

Step 2: borrow a known-good response

The researcher changed approach. A different path on the same website was opened, one that returned 200 OK and was reachable without authentication, and its response was copied. The response to the SSO login page request was then intercepted in Burp.

A few terms here. A path is the part of a web address after the domain, for example /about or /account. A response is what the server sends back: a status code plus the content. The status code is a three-digit number summarising the outcome. 200 OK means "here is the content you asked for, all good". Other common ones are 404 for "not found" and 302 for "the thing you want is somewhere else, go there instead", which is how a redirect to a login page usually works.

So the researcher found a page that anyone can see, confirmed it answered with 200 OK, and copied that whole answer. Then, in Burp, the researcher paused the request to the protected page and held its response before it reached the browser. Intercepting means exactly that: Burp catches the message and waits for you to decide what to do with it.

Step 3: swap the response body and forward

The copied 200 OK response was pasted over the intercepted SSO login response, and the request was forwarded. Forwarding means letting Burp send the message on to its destination, in this case back to the browser.

The protected page was then reachable, even though the researcher should not have had access. That was the bug.

The write-up does not include the actual request or response, the hostname, the path, the headers or the body used, so the exact mechanics of the swap cannot be reproduced from it. What can be said is the shape of the trick: a normal successful response was substituted for the login response.

Why this works: the root cause

The report describes the issue as a logical flaw and does not analyse the server-side code. What the behaviour implies is that the access decision for the protected page was not enforced independently of what the client received. In plain terms, the access decision for the protected page was not enforced independently of what the client received.

A useful comparison is a nightclub with a bouncer who only checks your name at the door and then hands you a wristband. If the wristband is the only thing the bar staff look at, then anyone who can make a convincing wristband gets served. The proper design is for the bar staff to check the guest list themselves, every time. The researcher treated it as a logical issue in the site, without analysing where the gate was applied.

The method-change attempt did not work.

Impact

The researcher states that the page was reachable without the access they should have needed. The impact is therefore limited to what is shown: unauthenticated access to at least one SSO-protected page on the target.

Fix

The fix implied by the behaviour is to enforce the authorisation decision on the server for every request to the protected resource, so that the protected content is never returned to an unauthenticated client regardless of what response the client or an intermediary substitutes. In the nightclub comparison, the bar staff check the guest list themselves rather than trusting a wristband.

Variants to test

If you want to look for the same pattern on a target you are allowed to test, these are the variations the write-up points towards:

  • Request a protected path directly and watch for protected content appearing before the SSO redirect. A positive result is any protected markup, data or API payload arriving before the login page. An API is the part of a site that returns raw data rather than a finished page, usually for another program to consume.
  • Replace the response to a protected request with a 200 OK response copied from an unauthenticated path on the same site. A positive result is the protected page rendering with the substituted response.
  • Try other methods (POST, TRACE, and others) against the protected path. A positive result is any method returning protected content instead of the login gate.
  • Look for the same pattern on other subdomains of the same target, since the enumeration step is what surfaced this host in the first place.

Glossary

  • Authentication: proving who you are, usually with a username and password or a login provider.
  • Authorisation: deciding what a proven user is allowed to see or do.
  • SSO (single sign-on): a login system where one account gives access to several separate services.
  • Authentication bypass: getting into something without completing the login it was supposed to require.
  • HackerOne: a platform where companies invite researchers to test their systems and report problems.
  • Target: the set of systems a company has agreed can be tested.
  • Domain: the main address of a website, such as example.com.
  • Subdomain: a prefix added to a domain, such as shop.example.com, often a separate application.
  • Subdomain enumeration: finding all the subdomains that exist for a domain.
  • Bash: a way of running a list of commands on a computer in order.
  • Python: a programming language often used for small utility scripts.
  • Proxy: a middleman between your browser and a website that lets you read and change the messages.
  • Burp: a proxy tool used to inspect and modify web traffic.
  • HTTP method: the word at the start of a request saying what action you want, such as GET, POST or TRACE.
  • GET: a request asking for a page or resource.
  • POST: a request that sends data to the server, such as a login form.
  • TRACE: an older method that asks the server to echo the request back.
  • Request: the message your browser sends to a server.
  • Response: the message the server sends back, containing a status code and content.
  • Status code: a three-digit number summarising the outcome of a request.
  • 200 OK: the status code meaning the requested content is being returned successfully.
  • 404: the status code meaning the requested thing was not found.
  • 302: the status code meaning the requested thing is elsewhere and the client should go there instead, commonly used for login redirects.
  • Redirect: an instruction to the browser to go to a different address.
  • Path: the part of a web address after the domain, such as /about.
  • Header: extra information attached to a request or response, such as the content type.
  • Body: the main content of a request or response.
  • Intercept: pausing a message in a proxy so you can read or change it before it is sent on.
  • Forward: sending an intercepted message on to its destination.
  • Client: the program making the request, usually the browser.
  • Server: the computer that stores the site and answers requests.
  • API: the part of a site that returns raw data for another program to use, rather than a finished page.
  • Payload: the data carried inside a request or response.
  • Logical issue: a mistake in how a site decides who may do what, rather than a flaw in a password or certificate.
  • Client-side check: a check performed in the browser, which the user can usually change or skip.
  • Server-side check: a check performed on the server, which the user cannot skip.
  • Unauthenticated: not logged in.
  • Triage: the process by which a company reviews a reported bug and decides whether it is valid.

More by zer0d

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.