Repository navigation
fix(sonar): drop argv-derived paths from update-platforms (tssecurity:S8707) - #233
Merged
Merged
Conversation
…: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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Follow-up to #206. That PR wrapped the
process.argvpath overrides in a customresolveFromCwdguard, but Sonar's taint analysis does not recognize the guard — it still traces the CLI value toreaddirSync/readFileSync/writeFileSync. As a result all 6tssecurity:S8707issues are still open onmain(latest analysis, revision4e1ce130, 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.mtsChanges
tests/e2e/update-platforms.mts: use fixedtest-results/platforms/PLATFORMS.mdconstants.tests/visual/update-platforms.mts: use fixedtest-results/visual/PLATFORMS.mdconstants.tests/util/resolve-from-cwd.mts: removed (no remaining users).Removing the CLI source means no
argvvalue can reach a filesystem sink.Verification
pnpm run lint:check,pnpm run typecheck,pnpm test— 129 passed.node tests/e2e/update-platforms.mtsagainst a sample result file (it updatedPLATFORMS.md, then reverted).https://sonarcloud.io/project/issues?id=gitify-app_electron-menubar&s=IMPACT_RANK&issueStatuses=OPEN&rules=tssecurity%3AS8707