Email templates XSS by filterXSS bypass
The email template preview used the js-xss library with a custom onIgnoreTag function that could be bypassed due to parsing differences between the library and the browser, allowing an attacker to inject JavaScript. By forcing a victim to log into the attacker's account via an HMAC-authenticated URL, the attacker could execute the XSS in the victim's browser and read pages authenticated as the victim, leading to account takeover with user interaction.
- Triaged in 13 days
- Fixed in 14 days
- Paid in 13 days
- Disclosed after 6 months
Summary by the program
XSS in js-xss with onIgnoreTag option.
js-xss is used to prevent XSS on email templates previews but the custom onIgnoreTag function can be used to bypass this filter. This leads to a Self-XSS scenario that can be used to achieve Account Takeover in 1-click.
The way how js-xss parse tags starting with <![ differ from how browser parse it, so it's possible to abuse this in this way:
<![endif]-- onerror="<![endif]-->" onload="<img src=1 onerror='alert(1)' />">
The report
Summary:
js-xss is used to prevent XSS on email templates previews but the custom onIgnoreTag function can be used to bypass this filter. This leads to a Self-XSS scenario that can be used to achieve Account Takeover in 1-click.
onIgnoreTag: function (e, t) {
return "!--[if" === e || "![endif]--" === e || "<!-->" === t ? t : void 0;
},
XSS
The way how js-xss parse tags starting with <![ differ from how browser parse it, so it's possible to abuse this in this way:
<![endif]-- onerror="<![endif]-->" onload="<img src=1 onerror='alert(1)' />">
Sending this as the HTML email template will trigger an XSS when the email is previewed. Since email templates are private and only the owner of the template can preview it, this can be considered a Self-XSS. But there is a way to do another user preview it, leading to an account takeover in 1-click. We can use HMAC authentication feature to force another user login in our account and preview the malicious email:
https://www.judge.me/shop/emails/2243518/edit?no_iframe=1&shop_domain=wordpress.caueo.me&platform=woocommerce&hmac=████
This URL authenticates as admin on wordpress.caueo.me domain, where the malicious email will be. The HMAC hash is created on this way (taken from wordpress plugin):
$hmac = hash_hmac( 'sha256', "no_iframe=1&platform=woocommerce&shop_domain={$domain}", $token, false );
Having this XSS with the victim logged in my account is possible to leak HTML content of a page that was loaded with victim's account cookie:
- Load an iframe with the victim's page (HTML content to leak) - Authenticated as victim
- Load another iframe with the XSS (Use HMAC authentication) - Authenticated as me
- We can use the XSS to read
parent.frames[0]HTML content since it is same-origin
CSP bypass
At a first sight we can't load an iframe to victim's page, since it has a CSP that whitelists iframe origins:
frame-ancestors https://wordpress.caueo.me http://wordpress.caueo.me wordpress.caueo.me https://woocommerce-adapter.judge.me/ *.judge.me
To bypass it we can use the XSS to load the iframes, but we need to do it on another subdomain, because to trigger this XSS is needed to login in my account and then it would not be possible to load the victim's page authenticated as victim's account later. So we trigger the XSS on www.judge.me subdomain.
Limitation to 0-click account takeover
At this point it is already possible to read HTML content of almost any page authenticated as victim. To achieve account takeover we only need to get the private API token from victim because it is used as the key of HMAC authentication.
The problem is that the endpoint that retrieves the API private token checks if the Referer header starts with https://judge.me/settings, so is not possible to load this endpoint in an iframe.
Clickjacking
We can load an iframe to https://judge.me/settings where has a button that retrieves the API token from the endpoint successfully. So it is possible to perform a clickjacking to that button, and if the victim clicks on it, we can get the API private token.
PoC
I made a PoC on how is possible to perform this account takeover with user interaction and leak some stuffs without user interaction. PoC
In this PoC I leaked FreshChat token without clickjacking, so we can impersonate another user in support chat without needing a user click.
Impact
Shop account takeover (user interaction) Impersonation on support chat Private content leak
Context
Judge.me is a product review platform for online shops, and the report concerns its email template feature. Shop owners can create HTML email templates, and the platform renders a preview of a template before it is used. Because the template body is HTML supplied by the user, the preview is a place where cross-site scripting would be dangerous, so the platform passes the template through js-xss, a JavaScript HTML sanitiser, before rendering it.
The sanitiser is configured with a custom onIgnoreTag callback. That callback is the subject of the report: the researcher found that it can be abused to bypass the filter, producing an XSS in the email template preview. On its own that is a Self-XSS, because templates are private and only their owner can preview them. The report then chains the XSS with the platform's HMAC authentication feature to make another user preview the malicious template, and from there to leak content and, with one click, take over a shop account.
Setup
The report describes the following preconditions:
- An attacker account on Judge.me with a shop, in the report
wordpress.caueo.meon the WooCommerce platform, holding the malicious email template. - A victim with a Judge.me shop account, who will be made to authenticate into the attacker's shop through the HMAC feature and then preview the template.
- Knowledge of the HMAC scheme used by the WordPress plugin to build the authentication URL, which the researcher took from the plugin source.
No tooling, versions or browser details are given beyond that.
Finding it
The researcher focused on the onIgnoreTag option of js-xss. The custom callback in use is:
onIgnoreTag: function (e, t) {
return "!--[if" === e || "![endif]--" === e || "<!-->" === t ? t : void 0;
},
The callback returns the tag text unchanged for a small set of conditional-comment fragments (!--[if, ![endif]--, and the case where the tag text is <!-->), returning undefined otherwise. The researcher noticed that the way js-xss parses tags beginning with <![ differs from the way a browser parses them. That difference between the sanitiser's parser and the browser's parser is the opening for the bypass.
Exploitation
Step 1: the XSS payload
The payload that abuses the parser difference is:
<![endif]-- onerror="<![endif]-->" onload="<img src=1 onerror='alert(1)' />">
Sending this as the HTML email template triggers an XSS when the email is previewed. The report does not spell out the exact parse tree the browser builds; the point is that js-xss and the browser disagree about where the tag starting with <![ ends, so the event handler attributes survive the filter and execute in the preview.
Because email templates are private and only the owner of a template can preview it, this on its own is a Self-XSS. The rest of the report is about removing that limitation.
Step 2: forcing the victim into the attacker's account with HMAC authentication
The platform has an HMAC authentication feature that logs a user into a shop from a signed URL. The researcher uses it to force another user to log in to the attacker's account and preview the malicious email:
https://www.judge.me/shop/emails/2243518/edit?no_iframe=1&shop_domain=wordpress.caueo.me&platform=woocommerce&hmac=████
This URL authenticates the visitor as admin on the wordpress.caueo.me domain, where the malicious email lives. The HMAC is computed as follows, taken from the WordPress plugin:
$hmac = hash_hmac( 'sha256', "no_iframe=1&platform=woocommerce&shop_domain={$domain}", $token, false );
The signed message is the query string no_iframe=1&platform=woocommerce&shop_domain={$domain}, hashed with SHA-256 in HMAC mode using a token as the key. The victim only has to open the signed URL.
Step 3: reading the victim's pages from the XSS
With the XSS running while the victim is logged in to the attacker's account, the researcher can leak the HTML content of a page that was loaded with the victim's account cookie. The sequence is:
- Load an iframe with the victim's page (the HTML content to leak), authenticated as the victim.
- Load another iframe with the XSS, using HMAC authentication, authenticated as the attacker.
- Use the XSS to read
parent.frames[0]HTML content, since it is same-origin.
The two frames are same-origin, so the script in the XSS frame can reach into the other frame and read its DOM.
Step 4: getting around the CSP
At first sight the victim's page cannot be framed, because it has a CSP that whitelists iframe origins:
frame-ancestors https://wordpress.caueo.me http://wordpress.caueo.me wordpress.caueo.me https://woocommerce-adapter.judge.me/ *.judge.me
To bypass it, the XSS itself loads the iframes. That has to happen on another subdomain, because triggering the XSS requires being logged in to the attacker's account, and after that it would not be possible to load the victim's page authenticated as the victim. So the XSS is triggered on the www.judge.me subdomain, which the frame-ancestors list allows.
Step 5: the limit on a 0-click account takeover
At this point it is already possible to read the HTML content of almost any page authenticated as the victim. To reach account takeover, the attacker needs the victim's private API token, because it is used as the key of the HMAC authentication. The obstacle is that the endpoint that retrieves the API private token checks that the Referer header starts with https://judge.me/settings, so the endpoint cannot be loaded in an iframe.
Step 6: clickjacking the token button
https://judge.me/settings can be framed, and it contains a button that retrieves the API token from the endpoint successfully. The researcher performs a clickjacking attack against that button: if the victim clicks it, the attacker obtains the private API token. With the token, the attacker obtains the key used for HMAC authentication, which is the account takeover.
Step 7: the PoC
The researcher published a PoC showing the account takeover with user interaction, and also leaking some data without user interaction:
https://www.judge.me/shop/emails/2243518/edit?no_iframe=1&shop_domain=wordpress.caueo.me&platform=woocommerce&hmac=█████████
In that PoC the researcher leaked a FreshChat token without clickjacking, which allows impersonating another user in the support chat without needing a user click.
Root cause
The root cause is the custom onIgnoreTag callback in the js-xss configuration. It returns the original tag text for a handful of conditional-comment fragments, and the sanitiser's parsing of tags that start with <![ does not match the browser's parsing. The payload exploits that mismatch so that attribute content the sanitiser treats as inert is interpreted by the browser as event handlers. The existing defence, the sanitiser, therefore does not stop the payload.
The rest of the chain is design-level. HMAC-signed URLs let one user be logged into another user's shop, which turns a private Self-XSS into something an attacker can deliver to a victim. The frame-ancestors CSP restricts framing but still allows *.judge.me, which is enough for the XSS to load the frames it needs. The API token endpoint's Referer check blocks framing of the endpoint itself, but the settings page that contains the button can still be framed, so a clickjacking step remains. The report does not describe any server-side change, so which of these was addressed is not stated.
Impact
The report lists the following impact:
- Shop account takeover, with user interaction (the clickjacked button that retrieves the API token).
- Impersonation on the support chat, by leaking a FreshChat token without user interaction.
- Private content leak, by reading HTML of pages loaded with the victim's cookie.
The account takeover depends on the victim opening the HMAC URL and then clicking the button; the content leak and the support chat impersonation do not require the click. The report hedges the content leak as "almost any page" authenticated as the victim.
Fix
The report does not describe a fix or a change made by the program.
Variants to test
- A positive result is a payload that the sanitiser passes through and the browser executes in a preview or rendered page.
- Other sanitiser and browser parser mismatches around
<![, conditional comments and malformed tag endings. A positive result is an event handler or script that survives filtering and fires. - HMAC-signed login URLs that accept a shop domain and platform from the query string. A positive result is a signed URL that logs a victim into an attacker-controlled shop.
frame-ancestorspolicies that include a wildcard subdomain where user content can execute. A positive result is an XSS on an allowed subdomain that can frame the target page.- Token endpoints protected only by a
Refererprefix check, with a framable settings page containing the retrieval button. A positive result is a clickjacked click that returns the token.
Hunting notes
This kind of bug tends to hide where user-supplied HTML is sanitised with a custom configuration, especially custom callbacks such as onIgnoreTag, and where the sanitiser's parser is known to differ from browsers. During recon, look for preview features for emails, templates or rich content, and for sanitiser options that return raw text for specific tag fragments. Also look at signed login URLs that carry a shop or tenant identifier, and at CSP frame-ancestors lists that include wildcard subdomains. The researcher chained the Self-XSS with the HMAC login to reach another user, demonstrated an account takeover requiring a click on the token button, and a no-click leak of a support chat token.
What happened, in plain words
Judge.me is a service that online shops use to collect and show product reviews. Part of it lets a shop owner build email templates: the HTML that gets sent out as a review-request email. Before a template is used, the owner can preview it in the browser. Because the template is HTML written by the user, the preview is a risky place: if the HTML could contain a script, that script would run inside the Judge.me site with the logged-in user's permissions. To prevent that, Judge.me passes the template through js-xss, a JavaScript library whose job is to clean HTML and remove anything dangerous.
That library was set up with a custom option called onIgnoreTag. The researcher found that this custom option can be abused to slip dangerous HTML past the cleaner. The result is a cross-site scripting (XSS) bug in the email template preview. On its own this is a "Self-XSS": templates are private, and only the person who owns a template can preview it, so you would only be attacking yourself. The interesting part of the report is how the researcher removed that limitation, using a login feature based on HMAC (a kind of cryptographic signature) to make another user open the malicious template. From there the attacker can read pages as the victim and, with one click from the victim, take over the victim's shop account.
The pieces involved
Before the steps, here are the parts of the system the report relies on, explained from scratch.
- HTML: the language web pages and emails are written in. It is made of "tags" such as
<img src=1>, and tags can carry "attributes" such asonerror="...", which is a piece of JavaScript that the browser runs when something goes wrong loading an image. - JavaScript: the programming language browsers run. A script running on a page can read and change that page, and can read cookies and other data the site has stored for the logged-in user.
- XSS (cross-site scripting): a bug where an attacker gets their own JavaScript to run inside someone else's site, in the victim's browser, as if the site itself had written it. Think of it as someone slipping a note into a company's official letterhead: the reader trusts it because it looks official.
- Sanitiser: a program that takes HTML and removes the dangerous parts before showing it.
js-xssis one. Think of a mail room that opens parcels and throws away anything that looks like a weapon. - Parser: the part of a program that reads text and decides what it means. The sanitiser has a parser, and the browser has its own parser. If the two disagree about what a piece of HTML means, a payload can look harmless to one and dangerous to the other. That disagreement is the heart of this report.
- Cookie: a small piece of data the browser stores for a site and sends back on every request. It is how a site remembers that you are logged in. If someone can read your cookie, they can often act as you.
- API: a way for one program to talk to another over the web, usually by requesting a URL and getting data back. An "API token" is a secret string that proves which account is making the request, like a password that a program uses instead of a human typing one.
- HMAC: a way to sign a piece of text with a secret key so that anyone holding the key can check the text was not changed. Here it is used to build login links: the link carries a signature, and the server checks the signature before logging the visitor in. Think of a wax seal on an envelope: if the seal is intact, the recipient trusts the contents.
- iframe: a page inside a page. A website can embed another website in a rectangular frame. JavaScript running in one frame can read another frame only if both are "same-origin" (same scheme, host and port), which is a browser safety rule.
- CSP (Content Security Policy): a set of rules a site sends to the browser, for example saying which other sites are allowed to put this site inside an iframe. The rule for that is called
frame-ancestors. - Referer header: when your browser follows a link or loads a resource, it can tell the server which page you came from. Servers sometimes check it as a weak form of access control.
- Clickjacking: tricking a user into clicking something they did not mean to click, usually by putting an invisible or disguised frame over a button.
Setup
The report describes three preconditions:
- An attacker account on Judge.me with a shop. In the report the shop is
wordpress.caueo.meon the WooCommerce platform, and it holds the malicious email template. - A victim with a Judge.me shop account. The victim will be made to log in to the attacker's shop through the HMAC feature and then preview the template.
- Knowledge of how the WordPress plugin builds the HMAC login URL. The researcher took that from the plugin's source code.
No tools, versions or browser details are given beyond that.
Finding it
The researcher looked at the onIgnoreTag option of js-xss. The custom callback in use is:
onIgnoreTag: function (e, t) {
return "!--[if" === e || "![endif]--" === e || "<!-->" === t ? t : void 0;
},
Line by line:
onIgnoreTag: function (e, t) {defines a function that the sanitiser calls whenever it meets a tag it does not recognise. It passes in two values:e, the tag name, andt, the full text of the tag.return "!--[if" === e || "![endif]--" === e || "<!-->" === t ? t : void 0;is one long decision. It checks three things: is the tag name exactly!--[if, or exactly![endif]--, or is the full tag text exactly<!-->? If any of those is true, it returnst, the original tag text, unchanged. Otherwise it returnsundefined, which tells the sanitiser to handle the tag normally.- The
? t : void 0part is JavaScript's shorthand for "if the condition is true, give backt; if not, give backundefined".
Those three strings are fragments of old-style "conditional comments", a trick Internet Explorer used to use to show different HTML to different browser versions. The callback exists so those fragments survive cleaning. The researcher noticed that the way js-xss parses tags beginning with <![ differs from the way a browser parses them. That mismatch between the sanitiser's parser and the browser's parser is the opening for the bypass.
Exploitation
Step 1: the XSS payload
The payload that abuses the parser difference is:
<![endif]-- onerror="<![endif]--">" onload="<img src=1 onerror='alert(1)' />">
What this is doing, in plain words: the text starts with <![, which the sanitiser treats as the beginning of a conditional comment and lets through because of the custom callback. The browser, however, does not read it the same way. It ends up treating the onerror and onload parts as attributes of a tag, and those attributes contain JavaScript. The inner <img src=1 onerror='alert(1)' /> is a classic test: an image that fails to load, which fires onerror, which runs alert(1), a pop-up box. If that pop-up appears in the preview, the script ran.
Sending this as the HTML email template triggers an XSS when the email is previewed. The report does not spell out the exact tree of tags the browser builds; the point is that js-xss and the browser disagree about where the tag starting with <![ ends, so the event-handler attributes survive the filter and execute in the preview.
Because email templates are private and only the owner of a template can preview it, this on its own is a Self-XSS. The rest of the report is about removing that limitation.
Step 2: forcing the victim into the attacker's account with HMAC authentication
The platform has an HMAC authentication feature that logs a user into a shop from a signed URL. The researcher uses it to force another user to log in to the attacker's account and preview the malicious email:
https://www.judge.me/shop/emails/2243518/edit?no_iframe=1&shop_domain=wordpress.caueo.me&platform=woocommerce&hmac=████
Reading the URL from left to right:
https://www.judge.me/shop/emails/2243518/editis the page for editing email template number 2243518.?starts the query string, the list of settings passed to the page.no_iframe=1is one of the parameters covered by the signature.shop_domain=wordpress.caueo.mesays which shop the visitor should be logged in to.platform=woocommercesays which shop platform that shop runs on.hmac=████is the signature.
This URL authenticates the visitor as admin on the wordpress.caueo.me domain, where the malicious email lives. The HMAC is computed as follows, taken from the WordPress plugin:
$hmac = hash_hmac( 'sha256', "no_iframe=1&platform=woocommerce&shop_domain={$domain}", $token, false );
Line by line:
hash_hmac(calls PHP's built-in function for making an HMAC.'sha256'is the hashing algorithm used inside the HMAC. SHA-256 turns any input into a fixed-length fingerprint."no_iframe=1&platform=woocommerce&shop_domain={$domain}"is the message being signed. It is the query string, with the shop domain filled in. Note the order of the parameters here isno_iframe, thenplatform, thenshop_domain.$tokenis the secret key used for the HMAC.falsemeans the function returns the signature as a lowercase hex string rather than raw binary.
The attacker can produce a valid URL for their own shop because they hold the token; the victim only has to open it. The signature is made with the key, and the URL authenticates the visitor as admin on the shop domain.
Step 3: reading the victim's pages from the XSS
With the XSS running while the victim is logged in to the attacker's account, the researcher can leak the HTML content of a page that was loaded with the victim's account cookie. The sequence is:
- Load an iframe with the victim's page (the HTML content to leak), authenticated as the victim.
- Load another iframe with the XSS, using HMAC authentication, authenticated as the attacker.
- Use the XSS to read
parent.frames[0]HTML content, since it is same-origin.
Why this works: parent means the page that contains the current frame, and frames[0] means the first frame inside it. Because both frames belong to the same site, the browser's same-origin rule allows the script in one frame to reach into the other and read its content. Because both frames are same-origin, the script in the XSS frame can read the other frame's HTML content.
Step 4: getting around the CSP
At first sight the victim's page cannot be framed, because it has a CSP that whitelists iframe origins:
frame-ancestors https://wordpress.caueo.me http://wordpress.caueo.me wordpress.caueo.me https://woocommerce-adapter.judge.me/ *.judge.me
This line is a list of who is allowed to put the page inside an iframe: the shop's own domain in three spellings, the WooCommerce adapter, and any subdomain of judge.me (that is what *.judge.me means).
To bypass it, the XSS itself loads the iframes. That has to happen on another subdomain, because triggering the XSS requires being logged in to the attacker's account, and after that it would not be possible to load the victim's page authenticated as the victim. So the XSS is triggered on the www.judge.me subdomain, which the frame-ancestors list allows. In other words, the attacker uses a page the policy trusts to build the frames the policy would otherwise block.
Step 5: the limit on a 0-click account takeover
At this point it is already possible to read the HTML content of almost any page authenticated as the victim. To reach account takeover, the attacker needs the victim's private API token, because it is used as the key of the HMAC authentication. With that key, the attacker could sign login links as the victim.
The obstacle is that the endpoint that retrieves the API private token checks that the Referer header starts with https://judge.me/settings, so the endpoint cannot be loaded in an iframe. The Referer check stops the endpoint being loaded in an iframe.
Step 6: clickjacking the token button
https://judge.me/settings can be framed, and it contains a button that retrieves the API token from the endpoint successfully. The researcher performs a clickjacking attack against that button: if the victim clicks it, the attacker obtains the private API token. With the token, the attacker can sign HMAC URLs as the victim, which is the account takeover.
The settings page can be framed and contains a button that retrieves the API token from the endpoint successfully. The attacker only has to get the victim to click.
Step 7: the PoC
The researcher published a PoC showing the account takeover with user interaction, and also leaking some data without user interaction:
https://www.judge.me/shop/emails/2243518/edit?no_iframe=1&shop_domain=wordpress.caueo.me&platform=woocommerce&hmac=█████████
This is the same kind of signed link as before: the edit page for template 2243518, with the shop domain, the platform and the signature. In that PoC the researcher leaked a FreshChat token without clickjacking, which allows impersonating another user in the support chat without needing a user click. The FreshChat token allows impersonating another user in the support chat.
Root cause
The root cause is the custom onIgnoreTag callback in the js-xss configuration. It returns the original tag text for a handful of conditional-comment fragments, and the sanitiser's parsing of tags that start with <![ does not match the browser's parsing. The payload exploits that mismatch so that attribute content the sanitiser treats as inert is interpreted by the browser as event handlers. The existing defence, the sanitiser, therefore does not stop the payload.
The rest of the chain is design-level. HMAC-signed URLs let one user be logged into another user's shop, which turns a private Self-XSS into something an attacker can deliver to a victim. The frame-ancestors CSP restricts framing but still allows *.judge.me, which is enough for the XSS to load the frames it needs. The API token endpoint's Referer check blocks framing of the endpoint itself, but the settings page that contains the button can still be framed, so a clickjacking step remains. The report does not describe any server-side change, so which of these was addressed is not stated.
Impact
The report lists the following impact:
- Shop account takeover, with user interaction (the clickjacked button that retrieves the API token).
- Impersonation on the support chat, by leaking a FreshChat token without user interaction.
- Private content leak, by reading HTML of pages loaded with the victim's cookie.
The account takeover depends on the victim opening the HMAC URL and then clicking the button; the content leak and the support chat impersonation do not require the click. The report hedges the content leak as "almost any page" authenticated as the victim.
Fix
The report does not describe a fix or a change made by the program.
Variants to test
- A positive result is a payload that the sanitiser passes through and the browser executes in a preview or rendered page.
- Other sanitiser and browser parser mismatches around
<![, conditional comments and malformed tag endings. A positive result is an event handler or script that survives filtering and fires. - HMAC-signed login URLs that accept a shop domain and platform from the query string. A positive result is a signed URL that logs a victim into an attacker-controlled shop.
frame-ancestorspolicies that include a wildcard subdomain where user content can execute. A positive result is an XSS on an allowed subdomain that can frame the target page.- Token endpoints protected only by a
Refererprefix check, with a framable settings page containing the retrieval button. A positive result is a clickjacked click that returns the token.
Hunting notes
This kind of bug tends to hide where user-supplied HTML is sanitised with a custom configuration, especially custom callbacks such as onIgnoreTag, and where the sanitiser's parser is known to differ from browsers. During recon, look for preview features for emails, templates or rich content, and for sanitiser options that return raw text for specific tag fragments. Also look at signed login URLs that carry a shop or tenant identifier, and at CSP frame-ancestors lists that include wildcard subdomains. The researcher chained the Self-XSS with the HMAC login to reach another user, demonstrated an account takeover requiring a click on the token button, and a no-click leak of a support chat token.
Glossary
- API token: a secret string that proves which account is making a request, like a password used by a program.
- Attribute: a setting written inside an HTML tag, such as
srcoronerror. - Callback: a function you hand to a library so the library can call it at a chosen moment.
- Clickjacking: tricking a user into clicking something they did not mean to click, often through a disguised frame.
- Cookie: a small piece of data the browser stores for a site and sends back on every request, used to remember that you are logged in.
- CSP (Content Security Policy): rules a site sends to the browser, for example which sites may embed it in a frame.
- Cross-site scripting (XSS): a bug where an attacker's JavaScript runs inside someone else's site, in the victim's browser, with that site's trust.
- DOM: the browser's in-memory model of a page, which scripts can read and change.
- Endpoint: a specific URL on a server that performs an action or returns data.
- frame-ancestors: the CSP rule that lists which sites are allowed to put a page inside an iframe.
- FreshChat: a customer support chat product; its token identifies the logged-in user to the chat widget.
- HMAC: a signature made from a message and a secret key, so the receiver can check the message was not changed and came from someone with the key.
- HTML: the language web pages and emails are written in, made of tags and attributes.
- iframe: a page embedded inside another page.
- js-xss: a JavaScript library that cleans HTML by removing dangerous parts.
- onIgnoreTag: the
js-xssoption that lets you supply a function to decide what happens to tags the library does not recognise. - Origin: the combination of scheme, host and port that identifies a site for browser safety rules.
- Payload: the piece of input an attacker sends to trigger a bug.
- PoC (proof of concept): a demonstration that a bug can actually be exploited.
- Query string: the part of a URL after
?, carrying settings as name=value pairs. - Referer header: a header telling the server which page the request came from.
- Same-origin: two pages with the same scheme, host and port; scripts in one may read the other.
- Sanitiser: a program that removes dangerous parts from HTML before it is shown.
- Self-XSS: an XSS that only affects the person who triggers it, because they are attacking their own session.
- SHA-256: a hashing algorithm that turns any input into a fixed-length fingerprint.
- WooCommerce: a shop platform for WordPress; here it identifies which platform the shop runs on.
- WordPress plugin: an add-on for WordPress that adds features; here it contains the code that builds the HMAC login URL.