Open Redirection while saving User account Settings
The user settings page accepted a return_to parameter and redirected to it after saving, without validating that the destination was on the same site. An attacker could send a crafted link so that a victim, after saving their settings, was sent to an attacker-controlled site.
- Triaged in 15 hours
- Fixed in 7 days
- Paid in 7 days
- Disclosed after 8 days
Hi team , I got a Open redirection while saving account setting . This could lead to serious issues .
Endpoint :- https://moneybird.com/user/edit?return_to=//evil.com
##Reproduce :-
- Visit https://moneybird.com/user/edit?return_to=//evil.com and click on
Save. - You will be take to evil.com .
##Impact :- Attacker can redirect a user to a fake login page easily to get his login and other sensitive infos .
Thanks .
What the report shows
The target is Moneybird, and the feature involved is the user account settings page, specifically the save action on the user edit form. The researcher found that the page accepts a return_to parameter and, after the settings are saved, sends the browser to the value it carries.
The endpoint given in the report is:
https://moneybird.com/user/edit?return_to=//evil.com
The reproduction is short and direct:
- Visit the URL above.
- Click
Saveon the settings form. - The browser is taken to
evil.com.
The payload value is //evil.com, a protocol-relative URL. Because it starts with two slashes and no scheme, the browser resolves it against the current scheme, so from an HTTPS page it becomes https://evil.com. The report does not explain the mechanism; it only shows the value and the result.
The researcher describes the impact as an attacker being able to redirect a user to a fake login page to capture credentials and other sensitive information. It was disclosed on 15 November 2017 with a medium severity and a CVSS score of 4.3, classified as an open redirect.
Root cause
The likely mistake is that the application takes the return_to value from the query string and uses it as the post-save redirect target without checking that it points to a trusted destination. A check that only looks for a hostname substring, or that only rejects values starting with http:// or https://, would miss a protocol-relative value such as //evil.com, because the string does not contain a scheme at all. The report does not describe the server-side code, so the exact validation gap is inferred from the behaviour.
Impact
The report frames the impact as phishing: an attacker can redirect a user to a fake login page to obtain login and other sensitive information. Because the first hop is a real, trusted domain, the link is more convincing than a direct link to the attacker's site. The report hedges this as something an attacker "can" do; it does not demonstrate a working phishing page or any credential capture.
How this kind of bug works
An open redirect exists when an application takes a destination from user-controlled input and sends the browser there without restricting it to trusted targets. The common carriers are query parameters named things like return_to, next, redirect, url, continue, callback or dest, and they appear on login, logout, password reset, settings and checkout flows, anywhere the application wants to bring the user back after an action.
The subtlety is in how browsers parse URLs. A value beginning with // is protocol-relative: the browser keeps the current scheme and treats what follows as the host. A value beginning with / is a path on the current host. Values like https://evil.com, //evil.com, /\evil.com, https:evil.com and https://[redacted] all resolve differently, and a naive check that only compares a prefix or searches for the trusted domain as a substring will let some of them through. Encoded forms, double encoding and whitespace or control characters add further bypasses.
The defences are allowlists and structural parsing. The safest approach is to accept only relative paths that start with a single / and reject anything with a scheme, a host, or a leading //. Where absolute URLs are needed, parse the value with a proper URL parser and compare the resulting host against an explicit allowlist, rather than doing string matching. Mapping opaque identifiers to known destinations, instead of passing URLs through, removes the problem entirely.
How to test for it
Look for parameters that carry a destination, especially on flows that end with a redirect: login, logout, registration, password reset, email confirmation, settings saves and payment returns. Also watch for hidden form fields and JSON body fields with the same names, since the value may travel in a POST rather than the query string.
A practical method:
- Identify a parameter whose value influences where you land after an action.
- Send a value pointing at a host you control, starting with the simplest form: a full URL with your scheme and host.
- If that is blocked, try protocol-relative (
//your-host), then backslash variants, then encoded variants, then userinfo tricks such ashttps://trusted.example@your-host. - Complete whatever action triggers the redirect and observe the
Locationheader or the browser's final address. - Confirm the redirect actually leaves the site, not just that your string appears somewhere in the response.
A positive result is a response that sends the browser to your host, or a browser that visibly navigates there. Common false positives: the value is reflected into the page body but never used for navigation; the redirect is blocked by a client-side check that a real victim's browser would also enforce; the parameter is only honoured for authenticated users and you tested unauthenticated; or the redirect goes to a path on the same host that merely contains your string. Also check whether the application validates the value only on one step of a multi-step flow.
How it is fixed
Use an allowlist of permitted destinations, or restrict the parameter to relative paths beginning with a single slash. Parse candidate URLs with a standard parser and compare the host exactly against trusted values, rejecting anything with a scheme, credentials, or a leading double slash. Reject or normalise encoded and control characters before validation. Where possible, replace raw URLs with opaque tokens that the server maps to known destinations. Apply the same validation on every step of a flow, not just the first.
Hunting notes
Open redirects tend to hide in secondary flows that developers add late: post-login returns, post-logout pages, language and locale switches, OAuth and SSO callbacks, email verification links, and settings pages that save and then bounce the user somewhere. Recon signals include parameters with destination-like names in links, forms and JavaScript, and redirects that carry a return_to or next value through several requests.
Explain the realistic attack path, such as a link on the trusted domain leading to a credential-harvesting page, and note any interaction the victim must perform.
What happened, in plain words
Every user has an account settings page where they can change details about themselves. When you press the save button on that page, the site needs to decide where to send your browser next, and it lets the address bar tell it where to go.
The researcher found that the page reads a value called return_to from the web address and uses it as the destination after saving. The address given in the report is:
https://moneybird.com/user/edit?return_to=//evil.com
To understand this, you need to know what a URL is made of. A URL has a scheme (the https part, which says how to talk to the server), a host (the domain name, here moneybird.com), a path (/user/edit, which page on that site), and a query string (everything after the ?). The query string carries small pieces of information called parameters, written as name=value. Here the parameter is named return_to and its value is //evil.com.
The reproduction in the report is three steps:
- Visit the URL above.
- Click
Saveon the settings form. - The browser is taken to
evil.com.
Step 2 matters because the save is the moment the site decides to send you somewhere else; without it, nothing happens. Step 3 is the bug itself: the browser leaves Moneybird and lands on a domain the attacker chose.
The interesting part is the value //evil.com. It has no https:// in front of it, yet it still works. A value that starts with two slashes is called a protocol-relative URL. The browser reads it as "keep the same scheme as the page I am on, and treat what follows as the host". Since the settings page is served over HTTPS, //evil.com becomes https://evil.com.
The researcher describes the impact as being able to send a user to a fake login page in order to capture their login details and other sensitive information. The report does not show such a page or any captured credentials; it describes what an attacker could do. It also does not describe the server-side code, so the exact cause is not shown. The report was disclosed on 15 November 2017, rated medium severity with a CVSS score of 4.3, and classified as an open redirect.
In general, how this kind of bug works
An open redirect is a vulnerability where a site takes a destination from something the user can control, such as a parameter in the URL, and sends the browser there without limiting it to trusted places. Think of a receptionist who will forward your call to any number you write on a form, including a number belonging to someone pretending to be the company.
Parameters that carry destinations often have telling names: return_to, next, redirect, url, continue, callback or dest. They appear wherever a site wants to bring you back after an action: logging in, logging out, resetting a password, confirming an email, saving settings or returning from a payment. The same value can also travel in a hidden form field or in the body of a form submission rather than in the address bar, so it is worth checking both.
The tricky part is how browsers read URLs. These values all look similar but go to different places:
| Value | Where the browser goes |
|---|---|
/account |
A path on the current site |
//evil.com |
The host evil.com, using the current scheme |
https://evil.com |
The host evil.com over HTTPS |
https://[redacted] |
The host evil.com, with moneybird.com treated as a username |
A naive check that compares the start of the string, or searches for the trusted domain somewhere inside it, will let some of these through. Encoded characters and extra whitespace add more ways around such checks.
The reliable defence is an allowlist: a list of destinations that are explicitly permitted, with everything else rejected. The simplest version accepts only relative paths that begin with a single / and refuses anything containing a scheme, a host or a leading //. When full URLs are genuinely needed, the value should be parsed with a proper URL parser and the resulting host compared exactly against the allowlist, rather than matched as text. An even stronger approach is to stop passing URLs around altogether: the site hands out a short opaque identifier, and the server looks up the real destination for it.
In general, how to test for it
- Find a parameter whose value seems to decide where you land after an action.
- Try the simplest form first: a full URL pointing at a host you control.
- If that is blocked, try
//your-host, then backslash variants, then encoded variants, then the userinfo trick shown in the table above. - Complete the action that triggers the redirect and watch where the browser ends up, or look at the
Locationresponse header, which is the instruction a server sends to tell the browser to go elsewhere. - Confirm the browser really leaves the site, rather than your text merely appearing somewhere on the page.
A real finding is a response that sends the browser to your host, or a browser that visibly navigates there. Watch out for false alarms: your value may be echoed into the page without ever being used for navigation, a client-side check may block it in a real browser, the parameter may only work for logged-in users, or the redirect may stay on the same site on a path that happens to contain your text. It is also worth checking whether the value is validated on only one step of a multi-step flow.
In general, how it is fixed
Use an allowlist of permitted destinations, or restrict the parameter to relative paths starting with a single slash. Parse candidate URLs with a standard parser and compare the host exactly against trusted values, rejecting anything with a scheme, credentials or a leading double slash. Reject or normalise encoded and control characters before validating. Where possible, replace raw URLs with opaque tokens that the server maps to known destinations. Apply the same validation at every step of a flow, not just the first.
Glossary
- URL: the address of a resource on the web, made up of a scheme, host, path and optional query string.
- Scheme: the first part of a URL, such as
https, which says how to communicate with the server. - Host: the domain name in a URL, such as
moneybird.com, identifying which server is being addressed. - Path: the part of a URL after the host, such as
/user/edit, identifying a page or resource on that server. - Query string: the part of a URL after the
?, carrying parameters. - Parameter: a
name=valuepair in a query string or form, used to pass information to the site. - Endpoint: a specific URL on a site that performs a particular action.
- Protocol-relative URL: a URL starting with
//that borrows the current page's scheme and treats the rest as the host. - Open redirect: a vulnerability where a site sends the browser to a destination supplied by the user without restricting it to trusted targets.
- Redirect: an instruction, usually from the server, telling the browser to load a different address.
Locationheader: the response header a server uses to tell the browser where to go next.- Allowlist: an explicit list of permitted values, with everything not on the list rejected.
- URL parser: software that breaks a URL into its parts so they can be checked individually.
- Userinfo: the optional username and password section of a URL, placed before the host and separated from it by
@. - Phishing: tricking someone into entering their credentials on a page that imitates a trusted service.
- Credentials: the login details, such as a username and password, used to access an account.
- CVSS: a standard scoring system for rating the severity of a vulnerability.
- Severity: a rating of how serious a vulnerability is, here medium.
- Vulnerability: a weakness in software that an attacker can use to cause harm.
- False positive: a test result that looks like a finding but is not actually exploitable.