From POST to GET Open redirect
The login and logout endpoints on manage.statuspage.io accepted a redirect parameter and sent signed-in users to an arbitrary external site. An attacker could craft a link that, once a logged-in user followed it, redirected them to a site the attacker controlled.
Published on medium.com
Hey ! Iโm Sourav Sahana from India.
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
This is the write-up of a first bug bounty by Sourav Sahana (@kernel_rider), found on a program hosted on Bugcrowd. The endpoints involved are on manage.statuspage.io. The feature involved is the login and logout flow: both endpoints accept a redirect parameter that tells the application where to send the user after the action completes.
Normally that parameter should only point back into the application. In the reported behaviour it accepted an arbitrary external URL, so a signed-in user could be sent to an attacker-controlled site after logging in or logging out.
Setup
The report describes no special tooling, accounts or versions. The researcher was working as a beginner hunter, testing the program on Bugcrowd, and the only precondition that matters is stated explicitly in the report: the redirect only fires when the user is already signed in. If the user is not signed in, the application first asks them to log in and then performs the redirect.
Finding it
After a run of duplicates and not-applicable reports, the researcher was testing cookie invalidation on the program. That test failed, but while searching, the following endpoint turned up in the search bar:
https://manage.statuspage.io/login?redirect=%2fpages/
The redirect parameter held %2fpages/, the URL-encoded form of /pages/, an internal path. Changing that value to an external host caused the application to redirect to evil.com. Because the redirect only happened for an already signed-in user, the researcher still considered it a valid issue and reported it.
Two days later the report was moved from P4 to P5 on the grounds that the issue was POST based. That downgrade is what pushed the researcher to keep digging.
Exploitation
Step 1: the login endpoint
The first finding was the redirect parameter on the login endpoint:
https://manage.statuspage.io/login?redirect=%2fpages/
Replacing the encoded internal path with an external URL made the application redirect to evil.com. The limit is that this only works for a user who is already signed in; otherwise the login prompt comes first and the redirect happens afterwards. The report was initially rated P4 and then reduced to P5 as POST based.
Step 2: the logout endpoint
Digging further, the researcher found a second endpoint that took the same parameter:
https://manage.statuspage.io/logout?redirect=https%3A%2F%2Fevil.com/
Here redirect carries https%3A%2F%2Fevil.com/, the URL-encoded form of https://evil.com/. The researcher also pointed out to the program that a user who is already signed in is simply redirected to evil.com. The next day the report moved from P5 to P4 and was accepted as a valid bug. This was the first valid finding, with a bounty of $100.
Step 3: the fix that did not fix it
A month later the program replied that the issue had been fixed. The researcher replied that the redirect still worked using this URL:
https://manage.statuspage.io/logout?redirect=https%3A%2F%2Fbugcrowd.com/
The program's answer was that https://manage.statuspage.io/logout would be considered a different endpoint, and the researcher was encouraged to submit it as a separate report so it could be tracked separately. A second report was submitted and paid $50.
Step 4: resolved but still reproducible
A month after that, the report was flagged as Resolved. The bug was not actually fixed, and the program gave the researcher two weeks to show it could still be reproduced. The researcher replied that yes, it could. There was no reply from the program's side.
Step 5: reporting again
After the two weeks the researcher reported the bug again. This time it was rated P3, with no explanation given in the report, and paid $300. The total earned across the reports was $450.
Root cause
The application takes the value of the redirect parameter and uses it as the destination after login or logout without restricting it to internal paths or to an allowlist of trusted hosts. The report does not describe the server-side implementation, so the exact validation that was missing is not shown; what the behaviour demonstrates is that an absolute external URL supplied in the parameter is honoured.
The login report was downgraded as POST based, and the logout endpoint was handled as a separate endpoint rather than as the same class of bug. The report does not say what change was made when the issue was marked fixed, only that the redirect still worked afterwards.
Impact
A signed-in user who follows a crafted link to the login or logout endpoint can be redirected to an external site such as evil.com. The report shows this with evil.com and, in the later reproduction, with bugcrowd.com. The condition is explicit: the user must already be signed in, otherwise the login prompt comes first and the redirect follows it.
Fix
The behaviour it documents implies the fix should be to accept only relative paths, or to validate the redirect value against an allowlist of trusted destinations, on every endpoint that takes the parameter, including both login and logout, rather than treating each endpoint as a separate issue.
Variants to test
- Test every authentication-related endpoint that accepts a return URL: login, logout, signup, password reset, SSO callbacks and email confirmation. A positive result is a redirect to an external host you control after the action completes.
- Try the parameter with different encodings of the same external URL, such as
https%3A%2F%2Fevil.com/and a plainhttps://evil.com/, and with relative-looking values such as%2fpages/replaced by an absolute URL. A positive result is the browser leaving the application's origin. - Test the same parameter on endpoints the program considers separate, as happened here with
logoutafterloginwas reported. A positive result is that a fix applied to one endpoint does not cover the other. - Re-test after a fix is announced, using the original payload and a fresh external host. A positive result is that the redirect still fires, which is what happened in this report.
- Test the redirect while signed in and while signed out, to see whether the signed-out flow still ends at the external destination after login. A positive result is the external redirect in either state.
What happened, in plain words
Sourav Sahana, a beginner bug hunter from India, found a security bug in a website called Statuspage. Sourav tested endpoints on manage.statuspage.io.
The bug is called an open redirect. Normally, when you log in or log out of a website, the site can send you back to a page inside the site. The site uses a redirect parameter in the web address to remember where to send you. An open redirect happens when the site lets that parameter point to any other website, not just its own pages. An attacker can craft a link to the site that sends the victim to another site after login or logout.
Sourav found that the login and logout pages of Statuspage accepted a redirect value pointing to an external site such as evil.com. The catch was that the redirect only worked if the user was already signed in. If not, the site first asked the user to log in, and then performed the redirect. Sourav reported it, but two days later the report was changed from P4 to P5 because it was POST based. Sourav kept digging, found the logout endpoint with the same flaw, and eventually earned a total of $450 across several reports.
This article explains every step in plain language, assuming you only know how to use a browser and a computer. We will look at the exact web addresses and parameters involved, explain what they mean, and walk through what happened.
Context
This is the write-up of a first bug bounty by Sourav Sahana (@kernel_rider), found on a program hosted on Bugcrowd. Bugcrowd is a platform where companies invite security researchers to find bugs in their systems and reward them for valid findings. The affected asset is manage.statuspage.io, the management interface of Statuspage, where signed-in users administer their status pages. Statuspage is a product that lets organisations communicate the status of their services to their users. The feature involved is the login and logout flow: both endpoints accept a redirect parameter that tells the application where to send the user after the action completes.
An endpoint is simply a specific web address (URL) that the application responds to. For example, https://manage.statuspage.io/login is the endpoint for logging in. A parameter is a piece of information added to the end of a URL after a question mark, like ?redirect=.... It tells the application what the user wants to do or where to go next.
Normally that parameter should only point back into the application. In the reported behaviour it accepted an arbitrary external URL, so a signed-in user could be sent to an attacker-controlled site after logging in or logging out. This is the essence of an open redirect: the application trusts user-supplied input to determine where to send the browser next, without checking that the destination is safe.
Setup
The report describes no special tooling, accounts or versions. The researcher was working as a beginner hunter, testing the program on Bugcrowd, and the only precondition that matters is stated explicitly in the report: the redirect only fires when the user is already signed in. If the user is not signed in, the application first asks them to log in and then performs the redirect.
This means you do not need any hacking tools to try this yourself; a normal browser is enough. The key is to be logged in to the target application before testing the redirect.
Finding it
After a run of duplicates and not-applicable reports, the researcher was testing cookie invalidation on the program. A cookie is a small piece of data that a website stores in your browser to remember who you are or to keep you logged in. Cookie invalidation is a security measure that ensures a cookie cannot be reused after logout or after a certain time. The researcher was checking whether the application properly invalidated cookies, but that test failed. However, while searching, the following endpoint turned up in the search bar:
https://manage.statuspage.io/login?redirect=%2fpages/
This URL is the login page of the management interface. The part after the question mark is the query string, which contains one parameter: redirect. Its value is %2fpages/. In URLs, certain characters are encoded to avoid confusion. %2f is the URL-encoded form of the forward slash /. So %2fpages/ decodes to /pages/, which is an internal path on the site. This parameter tells the application: after a successful login, send the user to the /pages/ page.
The redirect parameter held %2fpages/, the URL-encoded form of /pages/, an internal path. Changing that value to an external host caused the application to redirect to evil.com. Because the redirect only happened for an already signed-in user, the researcher still considered it a valid issue and reported it.
Two days later the report was moved from P4 to P5 on the grounds that the issue was POST based. Bug bounty platforms often use priority ratings like P1 (most severe) to P5 (least severe). A POST-based request is one where the browser sends data in the body of an HTTP request, typically when submitting a form, as opposed to a GET request where data is in the URL. The report was changed from P4 to P5 as POST based, and the researcher kept investigating.
That downgrade is what pushed the researcher to keep digging.
Exploitation
Step 1: the login endpoint
The first finding was the redirect parameter on the login endpoint:
https://manage.statuspage.io/login?redirect=%2fpages/
This is the same URL we saw earlier. The redirect parameter originally contained %2fpages/, which is the encoded form of /pages/, an internal page. By replacing that value with an external URL, the researcher made the application redirect to evil.com. The limit is that this only works for a user who is already signed in; otherwise the login prompt comes first and the redirect happens afterwards. The report was initially rated P4 and then reduced to P5 as POST based.
Why did this happen? The application took the value of redirect and used it as the destination after login without checking that it was a safe, internal path. When the value was an absolute URL like https://evil.com, the browser followed it. This is the open redirect vulnerability.
Step 2: the logout endpoint
Digging further, the researcher found a second endpoint that took the same parameter:
https://manage.statuspage.io/logout?redirect=https%3A%2F%2Fevil.com/
Here redirect carries https%3A%2F%2Fevil.com/, the URL-encoded form of https://evil.com/. In URL encoding, %3A is :, and %2F is /. So the value decodes to https://evil.com/, an external site. The researcher also pointed out to the program that a user who is already signed in is simply redirected to evil.com. The next day the report moved from P5 to P4 and was accepted as a valid bug. This was the first valid finding, with a bounty of $100.
The same parameter existed on a different endpoint, so the issue was not isolated to login. The fact that the same parameter existed on a different endpoint showed that the issue was not isolated to login.
Step 3: the fix that did not fix it
A month later the program replied that the issue had been fixed. The researcher replied that the redirect still worked using this URL:
https://manage.statuspage.io/logout?redirect=https%3A%2F%2Fbugcrowd.com/
This URL is similar to the previous one, but the redirect value is now https%3A%2F%2Fbugcrowd.com/, which decodes to https://bugcrowd.com/. The researcher used a different external site to demonstrate that the redirect still accepted arbitrary external URLs. The program's answer was that https://manage.statuspage.io/logout would be considered a different endpoint, and the researcher was encouraged to submit it as a separate report so it could be tracked separately. A second report was submitted and paid $50.
This highlights a common issue in bug bounty programs: sometimes fixes are applied to one endpoint but not another, and researchers are asked to report each separately. It also shows that the redirect still worked after the fix was announced.
Step 4: resolved but still reproducible
A month after that, the report was flagged as Resolved. The bug was not actually fixed, and the program gave the researcher two weeks to show it could still be reproduced. The researcher replied that yes, it could. There was no reply from the program's side.
This is frustrating for a researcher: a report marked as resolved when the vulnerability still exists. The researcher had to wait and then report again.
Step 5: reporting again
After the two weeks the researcher reported the bug again. This time it was rated P3, with no explanation given in the report, and paid $300. The total earned across the reports was $450.
The same underlying issue was reported multiple times, and the researcher was paid each time. The report does not explain why the rating changed to P3.
Root cause
The application takes the value of the redirect parameter and uses it as the destination after login or logout without restricting it to internal paths or to an allowlist of trusted hosts. An allowlist is a list of allowed values; in this case, the application should only allow redirects to its own domain or to a list of trusted domains. The report does not describe the server-side implementation, so the exact validation that was missing is not shown; what the behaviour demonstrates is that an absolute external URL supplied in the parameter is honoured.
The existing defence, if any, did not stop it: the login endpoint was treated as POST based and downgraded, and the logout endpoint was handled as a separate endpoint rather than as the same class of bug, so fixing one did not cover the other.
Impact
An attacker who can get a signed-in user to follow a crafted link to the login or logout endpoint can have that user redirected to an arbitrary external site after the action completes. The report shows this with evil.com and, in the later reproduction, with bugcrowd.com. The condition is explicit: the user must already be signed in, otherwise the login prompt comes first and the redirect follows it.
However, the report does not explore this scenario; it only demonstrates the redirect.
Fix
The behaviour it documents implies the fix should be to accept only relative paths, or to validate the redirect value against an allowlist of trusted destinations, on every endpoint that takes the parameter, including both login and logout, rather than treating each endpoint as a separate issue.
A relative path is one that does not include a domain, like /pages/. If the application only allows relative paths, then an attacker cannot redirect to an external site. Alternatively, an allowlist could permit only specific domains.
Variants to test
- Test every authentication-related endpoint that accepts a return URL: login, logout, signup, password reset, SSO callbacks and email confirmation. A positive result is a redirect to an external host you control after the action completes.
- Try the parameter with different encodings of the same external URL, such as
https%3A%2F%2Fevil.com/and a plainhttps://evil.com/, and with relative-looking values such as%2fpages/replaced by an absolute URL. A positive result is the browser leaving the application's origin. - Test the same parameter on endpoints the program considers separate, as happened here with
logoutafterloginwas reported. A positive result is that a fix applied to one endpoint does not cover the other. - Re-test after a fix is announced, using the original payload and a fresh external host. A positive result is that the redirect still fires, which is what happened in this report.
- Test the redirect while signed in and while signed out, to see whether the signed-out flow still ends at the external destination after login. A positive result is the external redirect in either state.
Glossary
- Bug bounty: A program where organisations reward security researchers for finding and reporting bugs in their systems.
- Bugcrowd: A platform that hosts bug bounty programs and connects researchers with organisations.
- Statuspage: A service that lets organisations communicate the status of their services to users.
- Endpoint: A specific URL that an application responds to, often representing a function like login or logout.
- Parameter: A piece of data appended to a URL after a question mark, used to pass information to the application.
- Open redirect: A vulnerability where an application redirects users to an arbitrary external site based on user-supplied input, without validation.
- URL encoding: A way to represent special characters in a URL using percent-encoding, e.g.
%2Ffor/. - Cookie: A small piece of data stored by a website in the user's browser to maintain state, such as login sessions.
- Cookie invalidation: The process of making a cookie invalid, typically after logout or expiration, to prevent reuse.
- POST based: A request where data is sent in the body, often from a form submission, as opposed to a GET request where data is in the URL.
- P4, P5, P3: Priority ratings used by bug bounty programs, where P1 is typically the most severe and P5 the least.
- Allowlist: A list of allowed values; in this context, a list of trusted domains to which redirects are permitted.
- Relative path: A URL path that does not include a domain, such as
/pages/, which stays within the same site. - SSO: Single Sign-On, a mechanism that allows users to log in once and access multiple applications.
- Payload: The specific input or data used to exploit a vulnerability, such as the malicious URL in the
redirectparameter.