René's URL Explorer Experiment


Title: fix: create the logfile without a shell (CWE-78 command injection) by 07souravkunda · Pull Request #45 · browserstack/browserstack-local-ruby · GitHub

Open Graph Title: fix: create the logfile without a shell (CWE-78 command injection) by 07souravkunda · Pull Request #45 · browserstack/browserstack-local-ruby

X Title: fix: create the logfile without a shell (CWE-78 command injection) by 07souravkunda · Pull Request #45 · browserstack/browserstack-local-ruby

Description: What Local#start created the logfile by shelling out: if @is_windows system("echo > #{@logfile}") # Windows else system("echo '' > '#{@logfile}'") # Unix end Both pass the caller-supplied logfile path through /bin/sh (or cmd.exe), so shell metacharacters in the path are interpreted as commands (CWE-78, OS command injection). A logfile such as log' ; touch /tmp/pwned ; echo 'x (Unix) or NUL & calc.exe (Windows) runs arbitrary OS commands as the user running the gem. The logfile option is public API (start(options)) and the block runs on every start. Fix Replace the block with shell-free create/truncate: logfile_dir = File.dirname(@logfile) FileUtils.mkdir_p(logfile_dir) unless File.directory?(logfile_dir) begin File.write(@logfile, "") rescue SystemCallError => e raise BrowserStack::LocalException.new("Unable to open logfile: #{e.message}") end File.write treats the path purely as a filename — no shell is involved, so metacharacters can no longer execute. As a bonus this fixes logfile paths containing spaces or a missing subdirectory, which the old shell form silently failed on. Mirrors the fix already shipped in the Python binding. Tests Added BrowserStackLocalLogfileTest (2 regression tests, no credentials/network — they drive start with a fake binarypath to skip the download and stub start_command_args to abort before launching the binary): Test Pre-fix Post-fix metacharacter payload in logfile FAIL — injected touch executed pass space + missing-subdir path FAIL — sh: … No such file or directory pass Both verified to fail on the pre-fix code (revert local.rb to master, keep the test). Offline suite: 22 runs, 43 assertions, 0 failures. Live: a real tunnel was opened through the patched binding (BrowserStack::Local#start), a selenium-webdriver BrowserStack session (Windows 11 / Chrome) ran over it, and it stopped cleanly via .stop(). The new logfile code was exercised on a space-containing path in a not-yet-existing directory (created literally, then written to by the binary).

Open Graph Description: What Local#start created the logfile by shelling out: if @is_windows system("echo > #{@logfile}") # Windows else system("echo '' > '#{@logfile}'&qu...

X Description: What Local#start created the logfile by shelling out: if @is_windows system("echo > #{@logfile}") # Windows else system("echo '' &...

Opengraph URL: https://github.com/browserstack/browserstack-local-ruby/pull/45

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.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:347389a1-fb4c-a7f0-89a2-37ed277e8bf2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8174:1C619:5CFFAB:8389DE:6B04788C
html-safe-nonce54ee46e0af980e438351fd3b1abfd92763a1616a2146ced162d64f5aca1030bd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTc0OjFDNjE5OjVDRkZBQjo4Mzg5REU6NkIwNDc4OEMiLCJ2aXNpdG9yX2lkIjoiODg5OTI3MzE4Njk5ODAwNzE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac206aac0cbe5cd84bfdc154021b2df744a334c2174e810a666e7abfbc9822d24d
hovercard-subject-tagpull_request:4589245820
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-ruby/pull/45/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:altWhat Local#start created the logfile by shelling out: if @is_windows system("echo > #{@logfile}") # Windows else system("echo '' > '#{@logfile}'&qu...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/browserstack/browserstack-local-ruby git https://github.com/browserstack/browserstack-local-ruby.git
octolytics-dimension-user_id1119453
octolytics-dimension-user_loginbrowserstack
octolytics-dimension-repository_id51922935
octolytics-dimension-repository_nwobrowserstack/browserstack-local-ruby
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id51922935
octolytics-dimension-repository_network_root_nwobrowserstack/browserstack-local-ruby
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
releasecf73f57448d52b3a7b619195e182b33d3b3454ca
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/browserstack/browserstack-local-ruby/pull/45/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbrowserstack%2Fbrowserstack-local-ruby%2Fpull%2F45%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-ruby%2Fpull%2F45%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-ruby
Reloadhttps://github.com/browserstack/browserstack-local-ruby/pull/45/files
Reloadhttps://github.com/browserstack/browserstack-local-ruby/pull/45/files
Reloadhttps://github.com/browserstack/browserstack-local-ruby/pull/45/files
browserstackhttps://github.com/browserstack
browserstack-local-rubyhttps://github.com/browserstack/browserstack-local-ruby
Codehttps://github.com/browserstack/browserstack-local-ruby
Issues1 (1)https://github.com/browserstack/browserstack-local-ruby/issues
Pull requests6 (6)https://github.com/browserstack/browserstack-local-ruby/pulls
Actionshttps://github.com/browserstack/browserstack-local-ruby/actions
Projectshttps://github.com/browserstack/browserstack-local-ruby/projects
Security and qualityhttps://github.com/browserstack/browserstack-local-ruby/security
Insightshttps://github.com/browserstack/browserstack-local-ruby/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fbrowserstack%2Fbrowserstack-local-ruby%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-ruby%2Fissues%2Fnew%2Fchoose
07souravkundahttps://github.com/07souravkunda
release_1.5.1https://github.com/browserstack/browserstack-local-ruby/tree/release_1.5.1
locsec/WI-09e205d7https://github.com/browserstack/browserstack-local-ruby/tree/locsec/WI-09e205d7
Conversation 5 https://github.com/browserstack/browserstack-local-ruby/pull/45
Commits 1 https://github.com/browserstack/browserstack-local-ruby/pull/45/commits
Checks 5 https://github.com/browserstack/browserstack-local-ruby/pull/45/checks
Files changed https://github.com/browserstack/browserstack-local-ruby/pull/45/files
Please reload this pagehttps://github.com/browserstack/browserstack-local-ruby/pull/45/files
fix: create the logfile without a shell (CWE-78 command injection) https://github.com/browserstack/browserstack-local-ruby/pull/45/files#top
Show all changes 1 commit https://github.com/browserstack/browserstack-local-ruby/pull/45/files
b7b0d1a fix: create the logfile without a shell (CWE-78 command injection) 07souravkunda Sep 21, 2026 https://github.com/browserstack/browserstack-local-ruby/pull/45/commits/b7b0d1a39e0bf130a37044323cb945caffe6aafa
Clear filters https://github.com/browserstack/browserstack-local-ruby/pull/45/files
Please reload this pagehttps://github.com/browserstack/browserstack-local-ruby/pull/45/files
Please reload this pagehttps://github.com/browserstack/browserstack-local-ruby/pull/45/files
local.rb https://github.com/browserstack/browserstack-local-ruby/pull/45/files#diff-494dd42833842f0cd9c846d7f46fbd45118379a9f389b710eee5f6314e5cd7c6
browserstack-local-test.rb https://github.com/browserstack/browserstack-local-ruby/pull/45/files#diff-0bc53e459a5550e42da6e5efbfb46daea5f95fa50416654c15f71e83ba97fa70
https://github.com/browserstack/browserstack-local-ruby/blob/release_1.5.1/CODEOWNERS#L1
lib/browserstack/local.rbhttps://github.com/browserstack/browserstack-local-ruby/pull/45/files#diff-494dd42833842f0cd9c846d7f46fbd45118379a9f389b710eee5f6314e5cd7c6
View file https://github.com/browserstack/browserstack-local-ruby/blob/b7b0d1a39e0bf130a37044323cb945caffe6aafa/lib/browserstack/local.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-local-ruby/pull/45/{{ revealButtonHref }}
https://github.com/browserstack/browserstack-local-ruby/pull/45/files#diff-494dd42833842f0cd9c846d7f46fbd45118379a9f389b710eee5f6314e5cd7c6
https://github.com/browserstack/browserstack-local-ruby/pull/45/files#diff-494dd42833842f0cd9c846d7f46fbd45118379a9f389b710eee5f6314e5cd7c6
07souravkundahttps://github.com/07souravkunda
Sep 21, 2026https://github.com/browserstack/browserstack-local-ruby/pull/45/files#r4060566575
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/browserstack/browserstack-local-ruby/pull/45/files
07souravkundahttps://github.com/07souravkunda
Sep 21, 2026https://github.com/browserstack/browserstack-local-ruby/pull/45/files#r4060603437
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/browserstack/browserstack-local-ruby/pull/45/files
https://github.com/browserstack/browserstack-local-ruby/pull/45/files#diff-494dd42833842f0cd9c846d7f46fbd45118379a9f389b710eee5f6314e5cd7c6
https://github.com/browserstack/browserstack-local-ruby/blob/release_1.5.1/CODEOWNERS#L1
test/browserstack-local-test.rbhttps://github.com/browserstack/browserstack-local-ruby/pull/45/files#diff-0bc53e459a5550e42da6e5efbfb46daea5f95fa50416654c15f71e83ba97fa70
View file https://github.com/browserstack/browserstack-local-ruby/blob/b7b0d1a39e0bf130a37044323cb945caffe6aafa/test/browserstack-local-test.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-local-ruby/pull/45/{{ revealButtonHref }}
https://github.com/browserstack/browserstack-local-ruby/pull/45/files#diff-0bc53e459a5550e42da6e5efbfb46daea5f95fa50416654c15f71e83ba97fa70
https://github.com/browserstack/browserstack-local-ruby/pull/45/files#diff-0bc53e459a5550e42da6e5efbfb46daea5f95fa50416654c15f71e83ba97fa70
https://github.com/browserstack/browserstack-local-ruby/pull/45/files#diff-0bc53e459a5550e42da6e5efbfb46daea5f95fa50416654c15f71e83ba97fa70
Please reload this pagehttps://github.com/browserstack/browserstack-local-ruby/pull/45/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.