René's URL Explorer Experiment


Title: Keep the access key out of child argv; honour useCaCertificate without a proxy by 07souravkunda · Pull Request #180 · browserstack/browserstack-local-nodejs · GitHub

Open Graph Title: Keep the access key out of child argv; honour useCaCertificate without a proxy by 07souravkunda · Pull Request #180 · browserstack/browserstack-local-nodejs

X Title: Keep the access key out of child argv; honour useCaCertificate without a proxy by 07souravkunda · Pull Request #180 · browserstack/browserstack-local-nodejs

Description: Five fixes in the binary-download path, found by a security review of this repo. Each is small and independent; they are batched because they touch the same three files. 1. Access key no longer passed in child argv (CWE-214) LocalBinary.getSourceUrlSync spawned lib/fetchDownloadSourceUrl.js with the access key as a positional argument, so the key was visible to any local user via ps aux or /proc//cmdline for the duration of the spawn — a real concern on shared CI runners and multi-tenant hosts. The key now travels in the child's environment instead (/proc//environ is readable only by the owning user). The remaining argv slots shift down by one and fetchDownloadSourceUrl.js was updated to match. 2. useCaCertificate is honoured when no proxy is configured (CWE-295) lib/download.js only loaded the CA bundle inside the if (proxyHost && proxyPort) branch, so a caller-supplied TLS trust anchor was silently ignored whenever no proxy was set. While fixing that I found the same lines were also functionally broken: LocalBinary.downloadSync pushes literal undefined placeholders into the proxy slots when only a CA is configured, and those reach the child as the string "undefined" — which is truthy. The sync download therefore built an HttpsProxyAgent for host "undefined" and failed outright. Verified against unmodified master: # master: useCaCertificate set, no proxy Got Error in binary downloading request Error: getaddrinfo ENOTFOUND undefined --- bytes downloaded: 0 --- # this branch: same invocation Done --- bytes downloaded: 40605816 --- The proxy slots are now compared with the existing isUndefined helper (which lib/fetchDownloadSourceUrl.js already uses for exactly this reason), and the CA block moved outside the proxy branch. Confirmed the CA is genuinely the trust anchor: with an unrelated self-signed CA the download now fails with unable to get local issuer certificate instead of silently succeeding on the system store. 3. Retry unlink is a single ENOENT-tolerant call (CWE-362) retryBinaryDownload did an async fs.stat and then a synchronous fs.unlinkSync inside its callback. Collapsed into one fs.unlink that ignores the error: it removes the window between check and delete, and also removes the uncatchable throw that a failing unlinkSync raised from inside the stat callback. 4. Temp fallback is a user-private directory (CWE-377) getAvailableDirs fell back to os.tmpdir() itself — /tmp on Linux, which is world-writable — under the fixed, predictable name BrowserStackLocal. Since that file is chmod'd 0755 and then executed, another local user could pre-create the path or swap the file. The fallback is now a per-uid subdirectory created 0700, and it is rejected unless it is a real directory, owned by the current uid, and not group- or world-writable. Only the temp fallback is checked — $HOME/.browserstack and process.cwd() keep their existing behaviour, so a group-writable working directory (common on shared CI) still works as before. Note: on the temp-fallback path only, an existing /tmp/BrowserStackLocal is no longer reused, so the binary is re-downloaded once. 5. Semgrep CI image pinned to a digest (CWE-829) .github/workflows/Semgrep.yml referenced a mutable tag. Pinned to @sha256:c180f0c9… so a re-pointed tag cannot redirect CI to a different image. This matches the existing practice in the same file of pinning actions to commit SHAs. Refresh with docker manifest inspect returntocorp/semgrep:. Testing eslint lib/* index.js — clean. mocha --grep LocalBinary — Retries (the retryBinaryDownload path changed here) and Binary filename pass. The Download block errors with Invalid auth token on master too — those specs construct LocalBinary directly and never set binary.key, so this is pre-existing and unrelated. 15 targeted checks covering all five fixes — argv contains no key while the child still resolves it from env, argv positions still map correctly after the shift, CA applied/enforced without a proxy, retry proceeds on ENOENT, world-writable and symlinked temp dirs rejected, non-temp paths unaffected. Live: endpoint resolved and the 36 MB binary downloaded through the patched sync path with the token supplied only via env. Live: a tunnel started through this binding carried a real BrowserStack Automate session to a local page (bs-local.com), then stopped cleanly with no dangling process. No regression test was added for the digest pin (config-only). Not addressed here The daemon is still launched with --key in its argv, so the key remains visible in the process list for the tunnel's lifetime. Closing that needs a --key-file/env option in the BrowserStackLocal binary itself and a matching change across all six language bindings — tracked separately.

Open Graph Description: Five fixes in the binary-download path, found by a security review of this repo. Each is small and independent; they are batched because they touch the same three files. 1. Access key no longer pas...

X Description: Five fixes in the binary-download path, found by a security review of this repo. Each is small and independent; they are batched because they touch the same three files. 1. Access key no longer pas...

Opengraph URL: https://github.com/browserstack/browserstack-local-nodejs/pull/180

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:bda1e944-b28d-37e6-e113-8230ff9a53e2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC84E:1FD1:1494382:1BCEEE3:6B043D2D
html-safe-nonce8f4e9aed9d048cc1f01e661b31c01040bbdeab9375a219ea1f461997c01e1359
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODRFOjFGRDE6MTQ5NDM4MjoxQkNFRUUzOjZCMDQzRDJEIiwidmlzaXRvcl9pZCI6IjQwNDMyNzM2NTAwODUwNTE2OTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac928dc1f5cef91af0301fa6bb12eaf4a916bdb7b3818c8d622e92a06314823eba
hovercard-subject-tagpull_request:4279154537
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/browserstack/browserstack-local-nodejs/pull/180/files
twitter:imagehttps://avatars.githubusercontent.com/u/50537259?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/50537259?s=400&v=4
og:image:altFive fixes in the binary-download path, found by a security review of this repo. Each is small and independent; they are batched because they touch the same three files. 1. Access key no longer pas...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/browserstack/browserstack-local-nodejs git https://github.com/browserstack/browserstack-local-nodejs.git
octolytics-dimension-user_id1119453
octolytics-dimension-user_loginbrowserstack
octolytics-dimension-repository_id51923223
octolytics-dimension-repository_nwobrowserstack/browserstack-local-nodejs
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id51923223
octolytics-dimension-repository_network_root_nwobrowserstack/browserstack-local-nodejs
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release06dc448a76fe4751ac1db26524aefa3aa3e889a8
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbrowserstack%2Fbrowserstack-local-nodejs%2Fpull%2F180%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbrowserstack%2Fbrowserstack-local-nodejs%2Fpull%2F180%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=browserstack%2Fbrowserstack-local-nodejs
Reloadhttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files
Reloadhttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files
Reloadhttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files
browserstackhttps://github.com/browserstack
browserstack-local-nodejshttps://github.com/browserstack/browserstack-local-nodejs
Codehttps://github.com/browserstack/browserstack-local-nodejs
Issues25 (25)https://github.com/browserstack/browserstack-local-nodejs/issues
Pull requests29 (29)https://github.com/browserstack/browserstack-local-nodejs/pulls
Actionshttps://github.com/browserstack/browserstack-local-nodejs/actions
Projectshttps://github.com/browserstack/browserstack-local-nodejs/projects
Security and qualityhttps://github.com/browserstack/browserstack-local-nodejs/security
Insightshttps://github.com/browserstack/browserstack-local-nodejs/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fbrowserstack%2Fbrowserstack-local-nodejs%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fbrowserstack%2Fbrowserstack-local-nodejs%2Fissues%2Fnew%2Fchoose
07souravkundahttps://github.com/07souravkunda
release_1.5.14https://github.com/browserstack/browserstack-local-nodejs/tree/release_1.5.14
locsec/WI-82ae3d6dhttps://github.com/browserstack/browserstack-local-nodejs/tree/locsec/WI-82ae3d6d
Conversation 4 https://github.com/browserstack/browserstack-local-nodejs/pull/180
Commits 1 https://github.com/browserstack/browserstack-local-nodejs/pull/180/commits
Checks 5 https://github.com/browserstack/browserstack-local-nodejs/pull/180/checks
Files changed https://github.com/browserstack/browserstack-local-nodejs/pull/180/files
Please reload this pagehttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files
Keep the access key out of child argv; honour useCaCertificate without a proxy https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#top
Show all changes 1 commit https://github.com/browserstack/browserstack-local-nodejs/pull/180/files
7852a15 Keep the access key out of child argv; honour useCaCertificate withou… 07souravkunda Aug 14, 2026 https://github.com/browserstack/browserstack-local-nodejs/pull/180/commits/7852a152b8674c9f4594d7b43363f1c7f58d8a6e
Clear filters https://github.com/browserstack/browserstack-local-nodejs/pull/180/files
Please reload this pagehttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files
Please reload this pagehttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files
Semgrep.yml https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-93dcf82f9faa3ee9c420f45a76c781fc44eb797fec2f444ce1d899713d09d3b2
LocalBinary.js https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-5af64958aaf2b1a4a750ddf96b03cc5742385ee3429d829dd0052429f81d47f3
download.js https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-12d45781f0795c69838b6657fe7fc20701665270bf1c38d4777c6140ea0f72be
fetchDownloadSourceUrl.js https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-075376b6503b99e004449336eb36c037cea262ffcce89384b4b3765abd183dbb
https://github.com/browserstack/browserstack-local-nodejs/blob/release_1.5.14/CODEOWNERS#L1
.github/workflows/Semgrep.ymlhttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-93dcf82f9faa3ee9c420f45a76c781fc44eb797fec2f444ce1d899713d09d3b2
View file https://github.com/browserstack/browserstack-local-nodejs/blob/7852a152b8674c9f4594d7b43363f1c7f58d8a6e/.github/workflows/Semgrep.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-local-nodejs/pull/180/{{ revealButtonHref }}
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-93dcf82f9faa3ee9c420f45a76c781fc44eb797fec2f444ce1d899713d09d3b2
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-93dcf82f9faa3ee9c420f45a76c781fc44eb797fec2f444ce1d899713d09d3b2
https://github.com/browserstack/browserstack-local-nodejs/blob/release_1.5.14/CODEOWNERS#L1
lib/LocalBinary.jshttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-5af64958aaf2b1a4a750ddf96b03cc5742385ee3429d829dd0052429f81d47f3
View file https://github.com/browserstack/browserstack-local-nodejs/blob/7852a152b8674c9f4594d7b43363f1c7f58d8a6e/lib/LocalBinary.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-local-nodejs/pull/180/{{ revealButtonHref }}
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-5af64958aaf2b1a4a750ddf96b03cc5742385ee3429d829dd0052429f81d47f3
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-5af64958aaf2b1a4a750ddf96b03cc5742385ee3429d829dd0052429f81d47f3
07souravkundahttps://github.com/07souravkunda
Aug 14, 2026https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#r3783417129
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-5af64958aaf2b1a4a750ddf96b03cc5742385ee3429d829dd0052429f81d47f3
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-5af64958aaf2b1a4a750ddf96b03cc5742385ee3429d829dd0052429f81d47f3
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-5af64958aaf2b1a4a750ddf96b03cc5742385ee3429d829dd0052429f81d47f3
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-5af64958aaf2b1a4a750ddf96b03cc5742385ee3429d829dd0052429f81d47f3
07souravkundahttps://github.com/07souravkunda
Aug 14, 2026https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#r3783414477
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files
07souravkundahttps://github.com/07souravkunda
Aug 14, 2026https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#r3783416144
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-5af64958aaf2b1a4a750ddf96b03cc5742385ee3429d829dd0052429f81d47f3
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-5af64958aaf2b1a4a750ddf96b03cc5742385ee3429d829dd0052429f81d47f3
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-5af64958aaf2b1a4a750ddf96b03cc5742385ee3429d829dd0052429f81d47f3
https://github.com/browserstack/browserstack-local-nodejs/blob/release_1.5.14/CODEOWNERS#L1
lib/download.jshttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-12d45781f0795c69838b6657fe7fc20701665270bf1c38d4777c6140ea0f72be
View file https://github.com/browserstack/browserstack-local-nodejs/blob/7852a152b8674c9f4594d7b43363f1c7f58d8a6e/lib/download.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-local-nodejs/pull/180/{{ revealButtonHref }}
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-12d45781f0795c69838b6657fe7fc20701665270bf1c38d4777c6140ea0f72be
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-12d45781f0795c69838b6657fe7fc20701665270bf1c38d4777c6140ea0f72be
https://github.com/browserstack/browserstack-local-nodejs/blob/release_1.5.14/CODEOWNERS#L1
lib/fetchDownloadSourceUrl.jshttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-075376b6503b99e004449336eb36c037cea262ffcce89384b4b3765abd183dbb
View file https://github.com/browserstack/browserstack-local-nodejs/blob/7852a152b8674c9f4594d7b43363f1c7f58d8a6e/lib/fetchDownloadSourceUrl.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-local-nodejs/pull/180/{{ revealButtonHref }}
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-075376b6503b99e004449336eb36c037cea262ffcce89384b4b3765abd183dbb
https://github.com/browserstack/browserstack-local-nodejs/pull/180/files#diff-075376b6503b99e004449336eb36c037cea262ffcce89384b4b3765abd183dbb
Please reload this pagehttps://github.com/browserstack/browserstack-local-nodejs/pull/180/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.