Skip to content

fix(sonar): drop argv-derived paths from update-platforms (tssecurity:S8707) - #233

Merged
setchy merged 1 commit into
mainfrom
fix/sonar/tssecurity-S8707-followup
Oct 7, 2026
Merged

setchy merged 1 commit into
mainfrom
fix/sonar/tssecurity-S8707-followup

Conversation

@setchy

@setchy setchy commented Oct 7, 2026

Copy link
Copy Markdown
Member

Follow-up to #206. That PR wrapped the process.argv path overrides in a custom resolveFromCwd guard, but Sonar's taint analysis does not recognize the guard — it still traces the CLI value to readdirSync / readFileSync / writeFileSync. As a result all 6 tssecurity:S8707 issues are still open on main (latest analysis, revision 4e1ce130, i.e. after #206 merged).

Both workflows invoke these scripts with no arguments, so the overrides were unused:

  • .github/workflows/e2e.yml: node tests/e2e/update-platforms.mts
  • .github/workflows/visual-tray.yml: node tests/visual/update-platforms.mts

Changes

  • tests/e2e/update-platforms.mts: use fixed test-results/platforms / PLATFORMS.md constants.
  • tests/visual/update-platforms.mts: use fixed test-results/visual / PLATFORMS.md constants.
  • tests/util/resolve-from-cwd.mts: removed (no remaining users).

Removing the CLI source means no argv value can reach a filesystem sink.

Verification

  • pnpm run lint:check, pnpm run typecheck, pnpm test — 129 passed.
  • Smoke-tested node tests/e2e/update-platforms.mts against a sample result file (it updated PLATFORMS.md, then reverted).

https://sonarcloud.io/project/issues?id=gitify-app_electron-menubar&s=IMPACT_RANK&issueStatuses=OPEN&rules=tssecurity%3AS8707

…:S8707)

#206 wrapped process.argv path overrides in a custom resolveFromCwd guard,
but Sonar's taint analysis does not recognize the guard: the flow still
reaches readdirSync/readFileSync/writeFileSync, so all 6 S8707 issues stayed
open on main after that merge.

Both workflows invoke these scripts with no arguments, so the CLI overrides
were unused. Use fixed relative paths and delete the now-dead helper.
@setchy
setchy requested a review from afonsojramos as a code owner October 7, 2026 12:50
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@setchy
setchy merged commit f7c20d9 into main Oct 7, 2026
26 checks passed
@setchy
setchy deleted the fix/sonar/tssecurity-S8707-followup branch October 7, 2026 12:54
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