Skip to content
XSS Advisory Beginner CVE-2025-64710

GHSL-2025-076: Cross-site scripting (XSS) in bit platform Boilerplate WebInteropApp - CVE-2025-64710

The socialSignInCallback function in the Bit platform Boilerplate WebInteropApp read a url query parameter and assigned it directly to location.href without validation. An attacker could pass a JavaScript URL so that their script ran when a user opened the crafted link.

p Follow

Originally disclosed on GitHub Security Lab

Bit platform Boilerplate was affected by a cross-site scripting (XSS) vulnerability in the WebInteropApp, potentially allowing attackers to inject malicious scripts that compromise the security and integrity of web applications. Applications based on this Bitplatform Boilerplate might also be vulnerable.

p-, on GitHub Security Lab

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

Context

Bit platform Boilerplate is a project template published by bitplatform. Applications generated from the template inherit its client-side code, so a flaw in the template can propagate to every application built on it. The advisory notes explicitly that applications based on the Bitplatform Boilerplate might also be vulnerable.

The affected component is the WebInteropApp, and specifically its socialSignInCallback function. It reads parameters from the current query string and, depending on them, navigates the window to a URL supplied by the caller. That navigation is the feature's normal job, and it is also where the problem sits.

Setup

The vulnerability was tested against version v-9.10.0 of bitplatform. No accounts, roles or special tooling are described beyond the discovery method: the issue was found with the help of CodeQL's Client-side cross-site scripting query. The report does not describe any particular browser or operating system used for testing.

Finding it

The starting point was the socialSignInCallback function in WebAppInterop.ts. The function takes a url query parameter straight from the query string and assigns it to location.href. The url query parameter flows unchecked from the query string into the location.href sink, so a JavaScript URL passed in that parameter will be executed when the user opens the URL. This is a reflected cross-site scripting issue: the payload travels in the request and is reflected into the page's navigation sink.

Exploitation

Step 1: Identify the sink

The vulnerable code path reads the query string and writes one of its values into location.href:

JavaScript
private static async socialSignInCallback() {
        const urlParams = new URLSearchParams(location.search);
        const urlToOpen = urlParams.get('url')!.toString();
        const localHttpPort = urlParams.get('localHttpPort')?.toString();
        if (!localHttpPort) {
            [..]
            else {
                WebInteropApp.autoClose = false;
                location.href = urlToOpen;
            }
            return;
        }
        [..]
    }

The url parameter is extracted with URLSearchParams and converted to a string. A second parameter, localHttpPort, is also read. When localHttpPort is absent, execution enters the block containing the else branch, which sets autoClose to false and assigns the value to location.href; the report elides the surrounding branches with [..]. The report elides the surrounding branches with [..], so the exact conditions that select the else branch are not shown.

Step 2: Craft the URL

The attacker supplies a JavaScript URL in the url query parameter. When a victim opens the resulting link, the attacker-provided JavaScript is executed. The report does not include a concrete example URL or payload.

Step 3: Trigger execution

The victim only has to open the crafted URL. No further interaction with the application is described.

Root cause

The url query parameter flows unchecked from the query string into the location.href sink. Assigning to location.href is not inherently dangerous when the value is a normal http or https URL, but the browser also honours the javascript: scheme in that position, so any unvalidated value that reaches the sink can become script execution. The report does not describe any validation, allowlist or sanitiser that was present and bypassed; the value simply arrives unchecked. The advisory classifies the issue as CWE-79, improper neutralisation of input during web page generation.

Impact

The report states that this issue may lead to information disclosure. Because the flaw lives in a template, applications generated from the Bitplatform Boilerplate might also be vulnerable. The report does not enumerate specific data that could be read, nor does it describe any authentication or privilege requirement for the victim.

Fix

Version v-9.11.3, released on 2025-08-06, contains the fix. The general remedy for this class of bug is to validate the url parameter before assigning it to location.href, for example by parsing it and allowing only expected schemes and hosts, rather than passing the raw string through.

Variants to test

  1. Other parameters that reach a navigation sink. Look for query parameters read with URLSearchParams and later assigned to location.href, location.assign or window.open. A positive result is a javascript: value in that parameter executing when the page loads.
  2. Callback and return-URL handlers. Sign-in callbacks, OAuth return pages and interop bridges often take a destination URL from the query string. A positive result is the page navigating to an attacker-chosen scheme instead of the expected application URL.
  3. Template and boilerplate code. When a framework or template ships a client script like this one, test an application generated from it. A positive result is the same sink behaviour appearing in the generated application.

Hunting notes

This kind of bug tends to hide in client-side interop and callback code: functions that exist to move the browser from one place to another and therefore take a URL from the caller. During recon, look for JavaScript files with names suggesting interop, callbacks or sign-in handling, and search them for assignments to location.href fed by URLSearchParams. Static analysis helps here: the report credits CodeQL's Client-side cross-site scripting query with finding the issue, which is a good signal that a taint-tracking pass over client scripts is worth running before manual review. The impact case here rests on script execution via a crafted link, with information disclosure as the stated consequence.

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

What happened, in plain words

A company called bitplatform publishes a starter kit (a "template") that other people use to build their own web applications. The template includes a small piece of JavaScript that runs in the visitor's browser and handles a callback. That piece of code had a bug: it took a value from the address bar of the browser and used it to send the browser to a new page, without checking what kind of address it was. If someone put a special kind of address in there, the browser would run it as a program instead of just opening a page. That is called cross-site scripting, or XSS.

The problem was found with an automated code-scanning tool called CodeQL and an AI agent built by the GitHub Security Lab, and it was reported to bitplatform on 2025-07-30. A fixed version, v-9.11.3, came out on 2025-08-06. The issue got the identifier CVE-2025-64710.

Because the bug lives in a template, every application generated from that template may carry the same bug. The advisory says so explicitly.

Context

What the product is

A template is like a pre-built house kit: walls, wiring and plumbing are already in place, and you add your own furniture. Bit platform Boilerplate is such a kit for web applications, published by bitplatform. When a developer starts a new project from it, the generated application contains the template's code, including the code that runs in the visitor's browser (the "client side").

That is why a single flaw matters more than usual here: fix it in the template and every new application is safe; leave it in and every application built from the template inherits it. The advisory notes explicitly that applications based on the Bitplatform Boilerplate might also be vulnerable.

The affected part

The affected component is called the WebInteropApp, and inside it a function named socialSignInCallback. "Interop" here means code that lets different parts of a system talk to each other, in this case the browser window and the sign-in machinery. A "callback" is code that runs when something else has finished, like a delivery driver ringing your doorbell after the parcel has arrived.

This function reads a few values from the address the browser is on (the query string) and then moves the window to a URL taken from them. Moving the browser to a URL is the feature's normal job, and it is also where the problem sits.

Two ideas you need first

  • Query string: the part of a web address after the ? sign. In https://example.com/page?colour=blue&size=large, the query string is colour=blue&size=large. It is a list of name and value pairs, and the page's JavaScript can read them. Think of it as the notes you scribble on an envelope: the address still works, but the notes carry extra instructions.
  • location.href: a property of the browser window that holds the current address. Reading it tells you where you are; writing to it tells the browser to go somewhere else. It is the browser's steering wheel.

Setup

The vulnerability was tested against version v-9.10.0 of bitplatform. No accounts, roles or special tooling are described beyond the discovery method: the issue was found with the help of CodeQL's Client-side cross-site scripting query. The report does not describe any particular browser or operating system used for testing.

CodeQL is a static analysis tool: it reads source code without running it and looks for patterns that tend to be dangerous, such as a value from an untrusted place flowing into a dangerous place. The "Client-side cross-site scripting" query is one of its ready-made checks for exactly this kind of bug.

Finding it

The starting point was the socialSignInCallback function in WebAppInterop.ts. The function takes a url query parameter straight from the query string and assigns it to location.href. The url query parameter flows unchecked from the query string into location.href, so a JavaScript URL passed in that parameter will be executed when the user opens the URL.

A "scheme" is the first part of a web address, before the ://. https is a scheme, http is a scheme, and javascript is also a scheme. A javascript: address does not point at a page; it contains a small program, and the browser runs it. That is a legitimate browser feature, but it is dangerous when the address comes from someone else.

This is a reflected cross-site scripting issue: the payload travels in the request and is reflected into the page's navigation sink. "Reflected" means the bad value is not stored on the server; it comes in with the link and bounces straight back into the page. A "sink" is the place in the code where a value finally does something, here the line that steers the browser.

Exploitation

Step 1: Identify the sink

The vulnerable code path reads the query string and writes one of its values into location.href:

JavaScript
private static async socialSignInCallback() {
        const urlParams = new URLSearchParams(location.search);
        const urlToOpen = urlParams.get('url')!.toString();
        const localHttpPort = urlParams.get('localHttpPort')?.toString();
        if (!localHttpPort) {
            [..]
            else {
                WebInteropApp.autoClose = false;
                location.href = urlToOpen;
            }
            return;
        }
        [..]
    }

Line by line:

  1. private static async socialSignInCallback() { declares the function. async means it can wait for slow things (like network calls) without freezing the page. private static are visibility and ownership markers that do not matter for the bug.
  2. const urlParams = new URLSearchParams(location.search); takes the query string (location.search, the part after the ?) and wraps it in a helper object that can look values up by name. It is like turning the scribbled notes on the envelope into a tidy list.
  3. const urlToOpen = urlParams.get('url')!.toString(); asks the list for the value named url and turns it into text. The ! tells the code editor "trust me, this is not empty". This is the attacker-controlled value.
  4. const localHttpPort = urlParams.get('localHttpPort')?.toString(); reads a second parameter, localHttpPort. The ? means "if it is missing, do not crash". The ? means "if it is missing, do not crash".
  5. if (!localHttpPort) { checks whether that second parameter is absent. If it is absent, the code enters the block that contains the branch that matters here.
  6. [..] marks code the report leaves out.
  7. else { is the branch that runs when the earlier conditions inside the omitted code are not met.
  8. WebInteropApp.autoClose = false; sets a flag so the window will not close itself automatically.
  9. location.href = urlToOpen; is the sink: the value from the address bar is written into the browser's steering wheel. Whatever it is, the browser will follow it.
  10. return; stops the function here.
  11. The final [..] marks the rest of the function, which handles the case where localHttpPort is present.

The url parameter is extracted with URLSearchParams and converted to a string. A second parameter, localHttpPort, is also read. When localHttpPort is absent, execution enters the block containing the else branch, which sets autoClose to false and assigns the value to location.href; the report elides the surrounding branches with [..]. The report elides the surrounding branches with [..], so the exact conditions that select the else branch are not shown.

Step 2: Craft the URL

The attacker supplies a JavaScript URL in the url query parameter. When a victim opens the resulting link, the browser treats the value as script and executes it. The report does not include a concrete example URL or payload.

An "origin" is the combination of scheme, host and port, for example https://app.example.com:443. Scripts from one origin are normally kept apart from other origins.

Step 3: Trigger execution

The victim only has to open the crafted URL. No further interaction with the application is described.

An "open redirect" is a bug where a site sends you to an address of someone else's choosing. Annoying, and useful for phishing, but it only moves you. XSS runs code, so it can do whatever the page itself could do.

Root cause

The url query parameter flows unchecked from the query string into the location.href sink. Assigning to location.href is not inherently dangerous when the value is a normal http or https URL, but the browser also honours the javascript: scheme in that position, so any unvalidated value that reaches the sink can become script execution. The report does not describe any validation, allowlist or sanitiser that was present and bypassed; the value simply arrives unchecked. The advisory classifies the issue as CWE-79, improper neutralisation of input during web page generation.

An "allowlist" is a list of things that are permitted, with everything else refused. "Neutralising" input means making it harmless before use, for example by escaping characters. CWE-79 is the standard catalogue entry for cross-site scripting; CWE stands for Common Weakness Enumeration, a shared dictionary of bug types.

Impact

The report states that this issue may lead to information disclosure. Because the flaw lives in a template, applications generated from the Bitplatform Boilerplate might also be vulnerable. The report does not enumerate specific data that could be read, nor does it describe any authentication or privilege requirement for the victim.

"Information disclosure" means data the application can see is exposed to someone who should not have it. The report does not list which data that would be.

Fix

Version v-9.11.3, released on 2025-08-06, contains the fix. The general remedy for this class of bug is to validate the url parameter before assigning it to location.href, for example by parsing it and allowing only expected schemes and hosts, rather than passing the raw string through.

Parsing means taking the address apart into its pieces (scheme, host, path) and inspecting each one, instead of treating the whole string as an opaque instruction.

Variants to test

  1. Other parameters that reach a navigation sink. Look for query parameters read with URLSearchParams and later assigned to location.href, location.assign or window.open. A positive result is a javascript: value in that parameter executing when the page loads.
  2. Callback and return-URL handlers. Sign-in callbacks, OAuth return pages and interop bridges often take a destination URL from the query string. A positive result is the page navigating to an attacker-chosen scheme instead of the expected application URL.
  3. Template and boilerplate code. When a framework or template ships a client script like this one, test an application generated from it. A positive result is the same sink behaviour appearing in the generated application.

location.assign and window.open are two other ways JavaScript can send the browser somewhere; they are the same kind of steering wheel as location.href. OAuth is a common sign-in standard where you are sent to another service and then returned to the application, which is exactly the situation where a return address is taken from the query string.

Hunting notes

This kind of bug tends to hide in client-side interop and callback code: functions that exist to move the browser from one place to another and therefore take a URL from the caller. During recon, look for JavaScript files with names suggesting interop, callbacks or sign-in handling, and search them for assignments to location.href fed by URLSearchParams. Static analysis helps here: the report credits CodeQL's Client-side cross-site scripting query with finding the issue, which is a good signal that a taint-tracking pass over client scripts is worth running before manual review. The impact case here rests on script execution via a crafted link, with information disclosure as the stated consequence.

"Recon" is the early phase of looking around a target to see what it is made of. "Taint tracking" means following a value from where it enters (the query string) to where it is used (the sink), the same way you would follow a drop of ink through a pipe.

Timeline

Date Event
2025-07-30 Reported via PVR
2025-08-06 Version v-9.11.3 with fix released

PVR stands for a private vulnerability reporting channel: a way to tell a project about a security problem without publishing it to the world first.

Glossary

  • Allowlist: a list of values that are permitted, with everything else refused.
  • Callback: code that runs after another operation finishes, such as returning from a sign-in page.
  • Client side: code that runs in the visitor's browser rather than on the server.
  • CodeQL: a static analysis tool that reads source code and looks for dangerous patterns.
  • Cross-site scripting (XSS): a bug where someone else's input ends up being run as code in a page, letting it act as that page.
  • CWE: Common Weakness Enumeration, a shared catalogue of bug types; CWE-79 is cross-site scripting.
  • CVE: a public identifier for a specific security vulnerability.
  • Information disclosure: exposing data to someone who should not be able to see it.
  • Interop: code that lets separate parts of a system communicate.
  • javascript: scheme: an address that contains a program instead of pointing at a page; the browser runs it.
  • location.href: the browser property holding the current address; writing to it navigates the window.
  • Open redirect: a bug where a site sends you to an address chosen by someone else.
  • Origin: the combination of scheme, host and port that defines which scripts are trusted as the same site.
  • OAuth: a common sign-in standard where you authenticate at another service and are returned to the application.
  • Parsing: breaking a value into its parts so each can be inspected.
  • PVR: private vulnerability reporting, a channel for disclosing a bug privately to a project.
  • Query string: the name and value pairs after the ? in a URL.
  • Recon: the early phase of examining a target to understand its structure.
  • Reflected XSS: XSS where the payload arrives with the request and is echoed straight back into the page.
  • Scheme: the first part of a URL, such as https or javascript.
  • Sink: the place in code where a value finally has an effect, such as navigating the browser.
  • Static analysis: examining code without running it.
  • Taint tracking: following a value from where it enters to where it is used.
  • Template: a starter project that generated applications copy their code from.
  • URLSearchParams: a browser helper for reading name and value pairs from a query string.

More by p

View all

49 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

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.