Leaking OpenID tokens with “ — the bug right infront of you
The login flow used an OpenID redirectURL parameter that allowed redirection to attacker-controlled domains. By including an unencoded double quote in the redirectURL, the user's login token was leaked to the attacker's site after login.
Oauth
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
The target was a site called redacted.com in the write-up, which used an OpenID login system. The flow behaves like a standard OAuth login: the login endpoint takes a redirectURL parameter and, after a successful login, sends the browser to that URL. Along with the redirect, a login token is issued to the user, and the goal of the exercise was to get that token delivered to an attacker-controlled server instead.
The author notes that the same bug may affect other sites using an OpenID login flow, and that the chances of finding it improve when the target has misconfigured its redirect URL handling to allow *.theirdomain.com/*, because a wider scope makes it easier to find an open URL redirect to chain with.
Setup
No accounts, tools or versions are described beyond a normal login to redacted.com and the ability to host a page on an attacker-controlled domain. In this case the login endpoint accepted a redirectURL parameter and there was an open redirect on a subdomain of the target that could be reached through that parameter.
Finding it
The login endpoint accepted a relative path in redirectURL:
https://www.redacted.com/login?redirectURL=/here
By supplying a host under *.redacted.com in the parameter, the researcher could make the login flow redirect there. That gave an open URL redirect, but on the final hop to the attacker's site the user's login token was not appended, because it was set on a hash fragment (#).
The next idea was to nest the redirect inside a parameter with quote marks, in the hope that the token would be treated as a quoted parameter value during the redirect. The author admits this made little sense given the token lives in a hash fragment, but tried it anyway.
Exploitation
Step 1: chain the open redirect with a nested URL and a trailing quote
The vulnerable URL was:
The redirectURL value is URL-encoded and points at evil.redacted.com, with a nested url value pointing at www.mysite.com. The final ?c=" leaves a literal double quote unencoded at the end of the value.
When tested, the token was successfully obtained on the attacker's site, though not in the way the researcher expected.
Step 2: understand the encoding behaviour
The key detail is that the quote mark was left unencoded. Before redirecting to the attacker's site, redacted.com encoded " to ", and that encoding is what allowed the user's login token to be smuggled through with the redirect. Using %22 instead produced no token leak. It had to be the literal " character: no quote mark, no token.
The author stresses that understanding how a site handles certain encodings matters, especially when looking for filter bypasses. Encoding, and sometimes double encoding such as %252F, may be needed for a redirect to reach the intended destination, and this becomes evident while testing. For example, the following payload may not redirect successfully without encoding:
Step 3: final payload
The final payload was:
Upon the user logging in, their login token was sent to the attacker's server. Without the ", the bug did not work.

Root cause
The login flow takes a user-controlled redirectURL and follows it after a successful login, and the target's redirect handling permits hosts under *.redacted.com, which supplies the open redirect needed to bounce the user onward. The token is carried in a hash fragment, so a plain redirect to an external site does not expose it. The leak depends on the literal " being present in the redirectURL value: the site encodes it to " before redirecting, and that encoding is what lets the token be smuggled through to the attacker's site. Encoding the quote as %22 does not produce the leak. The exact mechanism inside the application is not described in the report.
Impact
The author received their own login token on the attacker's server after logging in, and notes that with the token they were now this user. The attack requires the target to accept a redirect to a host under its own domain (the open redirect) and to handle the literal quote character in the way described; the author notes the bug may affect other sites using a similar OpenID login flow, depending on how they handle encoding of certain characters and whether their redirectURL handling is misconfigured.
Fix
The report does not describe a fix or a change made by the program. Based on the behaviour described, the redirect handling should not accept arbitrary hosts, and the encoding of characters such as the quote mark in redirectURL should not allow the token to be carried through to an external destination.
Variants to test
- On any OpenID or OAuth login flow, try a
redirectURLpointing at a subdomain you control or one that is open to redirects, and check whether the token is appended on the final hop. - Append a literal
"to the end of theredirectURLvalue and compare with%22; a positive result is the token arriving at your server only in the literal-quote case. - Try double encoding such as
%252Fin the nested URL to see how the site decodes values in order; a positive result is the redirect reaching your intended destination where the single-encoded version did not. - Look for a misconfigured redirect allowlist that accepts
*.theirdomain.com/*, since that widens the scope for finding an open redirect to chain with the login flow.
What happened, in plain words
A security researcher found a way to leak a user's login token from a website's login page. The site is only ever called redacted.com in the write-up, so that is the name used here too.
When you log in to many sites, the site can send you back to a page you came from. It does this with a special link parameter called redirectURL, which simply means "where should I send you after you log in?". The site in this story used a login system called OpenID, which works like the more common OAuth login you have probably seen as "Log in with Google" or "Log in with Facebook". After a successful login, the site sends the browser to whatever address is in redirectURL, and it also hands the user a login token: a short piece of text that proves who you are, a bit like the wristband you get at a festival that lets you back in without showing your ticket again.
The researcher's goal was to make the site send that token to a server the researcher controlled, instead of to the real site. The author obtained their own token this way.
The trick turned out to be surprisingly small. The researcher built a link that pointed the login page at a page on a subdomain of the target site, which in turn pointed at the researcher's own site. At the very end of that link sat a single double-quote character, ", left unencoded. When the site processed the link, it converted that " into " (the HTML way of writing a double quote), and that small conversion is what let the token slip through to the attacker's server. If the quote had been written in its encoded form, %22, no token leaked. It had to be the literal ".

The author's point is that the bug was sitting right in front of everyone testing that login flow, and that it may affect other sites using a similar OpenID login, depending on how they handle characters like the quote and whether their redirect handling is misconfigured.
The login flow
When you log in to redacted.com, the site uses an OpenID system. In practice it behaves exactly like an OAuth login flow:
- You visit a login link that contains a
redirectURLparameter. - You log in.
- The site sends your browser to the address in
redirectURL. - Along with that redirect, a login token is issued to you.
A parameter is just a named value stuck on the end of a web address, after a ?, in the form name=value. In the link below, the parameter is called redirectURL and its value is /here:
https://www.redacted.com/login?redirectURL=/here
Line by line:
https://www.redacted.com/loginis the address of the login page.?marks the start of the parameters.redirectURL=/heretells the login page: after a successful login, send the browser to/hereon this same site.
The researcher could put a host under *.redacted.com into that parameter, meaning any subdomain of redacted.com. The login flow happily redirected there. That is an open URL redirect: a page that will send your browser to an address supplied by whoever built the link, without checking that the address is safe. Open redirects are common and often considered low impact on their own, but here the researcher wanted to chain one with the login flow.
The problem was the final hop. When the browser finally reached the researcher's own site, the user's login token was not there. The token was being set on a hash fragment, written #. A hash fragment is the part of a web address after a # sign. Browsers treat it as a position inside the page, and crucially it is not sent to the server as part of the request. So a plain redirect to an outside site did not carry the token along.
The next idea was to nest the redirect inside a parameter with quote marks, hoping that during the redirect the token would be treated as a quoted parameter value. The author admits this made little sense, since the token lives in a hash fragment, but tried it anyway. That is the spirit of the whole story: throw something at the page and see what happens.
Exploitation
Step 1: chain the open redirect with a nested URL and a trailing quote
The vulnerable URL was:
This looks like a wall of symbols, so break it into pieces. The %3A, %2F and %3F sequences are URL encoding: a way of writing characters that would otherwise confuse the address parser. %3A is a colon :, %2F is a slash /, and %3F is a question mark ?. Encoding is like putting a fragile item in a box before posting it: the contents arrive intact instead of being mangled on the way.
https://www.redacted.com/login?redirectURL=is the login page and the start of its parameter.https%3A%2F%2Fevil.redacted.com%2Fredirectdecodes tohttps://evil.redacted.com/redirect, a page on a subdomain of the target site.%3Furl%3Dhttps%3A%2F%2Fwww.mysite.com%2Fdecodes to?url=https://www.mysite.com/, so the page onevil.redacted.comitself takes aurlparameter pointing at the researcher's site.?c="is the tail end: a parameter calledcwhose value is a literal double quote, left unencoded on purpose.
So the chain is: login page, then a page on a subdomain of the target, then the researcher's own site. The researcher tested it, and the bug worked, though not in the way expected: the token did end up on the attacker's site.
Step 2: understand the encoding behaviour
The key detail is the quote mark. The researcher left it unencoded. Before redirecting to the attacker's site, redacted.com converted " into ". That is an HTML entity: a code that a browser displays as a double quote. Thanks to that simple conversion, the user's login token was smuggled through with the redirect to the researcher's site. Using %22, the encoded form of a double quote, produced no token leak. It had to be the literal ": no quote mark, no token.
This is why the author stresses that understanding how a site handles certain encodings matters, especially when you are looking for ways around filters. Encoding, and sometimes double encoding such as %252F, may be needed for a redirect to reach the intended destination. Double encoding means encoding the % sign itself, so %252F is decoded once to %2F and then again to /. This becomes obvious while you are testing. For example, the following payload may not redirect successfully without encoding:
Here the inner address is written in plain form, with real colons, slashes and question marks. The browser and the server both have to decide where the outer address ends and the inner one begins, and they can disagree. Encoding the inner address removes that ambiguity.
Step 3: final payload
The final payload was:
Upon the user logging in, their login token was sent to the attacker's server. Without the ", the bug did not work.

Why it worked
The login flow takes a redirectURL supplied by whoever builds the link and follows it after a successful login. The target's redirect handling also allowed hosts under *.redacted.com, which supplies the open redirect needed to bounce the user onward. The token is carried in a hash fragment, so a plain redirect to an outside site does not expose it. The leak depends on the literal " being present in the redirectURL value: the site encodes it to " before redirecting, and that encoding is what lets the token be smuggled through to the attacker's site. Encoding the quote as %22 does not produce the leak. The exact mechanism inside the application is not described in the report.
What an attacker could do with it
The author received their own login token on a server they controlled after logging in, and notes that with the token they were now this user. The attack requires the target to accept a redirect to a host under its own domain (the open redirect) and to handle the literal quote character in the way described. The author notes the bug may affect other sites using a similar OpenID login flow, depending on how they handle encoding of certain characters and whether their redirectURL handling is misconfigured.
How it should be fixed
The report does not describe a fix or a change made by the program. Based on the behaviour described, the redirect handling should not accept arbitrary hosts, and the encoding of characters such as the quote mark in redirectURL should not allow the token to be carried through to an external destination.
Things to try on other sites
- On any OpenID or OAuth login flow, try a
redirectURLpointing at a subdomain you control or one that is open to redirects, and check whether the token is appended on the final hop. - Append a literal
"to the end of theredirectURLvalue and compare with%22; a positive result is the token arriving at your server only in the literal-quote case. - Try double encoding such as
%252Fin the nested URL to see how the site decodes values in order; a positive result is the redirect reaching your intended destination where the single-encoded version did not. - Look for a misconfigured redirect allowlist that accepts
*.theirdomain.com/*, since that widens the scope for finding an open redirect to chain with the login flow.
Glossary
- OpenID: a login system that lets a site hand off the job of checking who you are, similar in behaviour to OAuth.
- OAuth: a widely used login flow where a site redirects you to a login service and then back again, often with a token.
- Login token: a short piece of text issued after login that proves who you are, like a wristband that lets you back in.
- Parameter: a named value attached to a web address after a
?, in the formname=value. redirectURL: the parameter that tells a login page where to send the browser after a successful login.- Open URL redirect: a page that sends your browser to an address supplied by whoever built the link, without checking that the address is safe.
- Hash fragment: the part of a web address after a
#; browsers treat it as a position inside the page and do not send it to the server. - URL encoding: writing characters such as
:,/and?as%codes so they survive the trip through an address parser. - Double encoding: encoding the
%sign itself, so%252Fis decoded once to%2Fand then again to/. - HTML entity: a code such as
"that a browser displays as a character, here a double quote. - Subdomain: a site under a larger domain, such as
evil.redacted.comunderredacted.com. - Allowlist: a list of things a system is permitted to accept; a misconfigured one accepts more than it should.
- Filter bypass: getting past a check that is meant to block certain input.
- Chain: combining two or more smaller issues so that together they do something more serious.