Skip to content

fix(sonar): invoke capture tools by absolute path (typescript:S4036) - #225

Merged
setchy merged 4 commits into
mainfrom
fix/sonar/typescript-S4036
Oct 7, 2026
Merged

setchy merged 4 commits into
mainfrom
fix/sonar/typescript-S4036

Conversation

@setchy

@setchy setchy commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Summary

tests/visual/run.mts spawned system binaries (screencapture, powershell, sh, grim, import) via PATH lookup, which rule typescript:S4036 flags when the PATH is mutable. All six calls now use their fixed install locations:

  • macOS: /usr/sbin/screencapture
  • Windows: %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe
  • POSIX shell: /bin/sh
  • Wayland: /usr/bin/grim
  • X11: /usr/bin/import

Findings

SonarQube rule typescript:S4036 flags execFileSync calls that resolve
executables through a potentially writable PATH. The screen-capture,
PowerShell, grim and import invocations now use their fixed install
locations so resolution is deterministic.
@setchy setchy changed the title fix(visual): address SonarQube typescript:S4036 findings fix(sonar): invoke capture tools by absolute path (typescript:S4036) Oct 3, 2026
@setchy setchy closed this Oct 3, 2026
@setchy setchy reopened this Oct 3, 2026
@setchy
setchy marked this pull request as ready for review October 4, 2026 03:34
@setchy
setchy requested a review from afonsojramos as a code owner October 4, 2026 03:34
@setchy
setchy marked this pull request as draft October 4, 2026 22:22
@setchy
setchy marked this pull request as ready for review October 7, 2026 12:15
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@setchy
setchy merged commit 8d6a17a into main Oct 7, 2026
28 checks passed
@setchy
setchy deleted the fix/sonar/typescript-S4036 branch October 7, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant