fix: maak make sast weer groen zonder de regel te verbreden #534
No reviewers
Labels
No labels
accepted
bug
declined
docs
duplicate
enhancement
good first issue
in-progress
needs-info
privacy
security
triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
LibreKAT/Ocideck!534
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/sast-chmod-subproces"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
make sasthad been red onmainsincedisk_traces.dartlanded. With #522 merged, both scanner gates are green again.Closes #521
The judgement
The rule
ocideck-subproces-buiten-de-gitlaagexists because a subprocess cannot be intercepted by NetGuard — it talks to the network outside the guard.chmodcannot: fixed argv, no shell, no external input (the path comes frompath_provider), Linux only, best-effort and unawaited.So it is a true positive for the rule's letter and a false positive for its intent. The issue offered narrowing the rule or removing the call; both are worse:
chmod, since Dart has no permission API — more attack surface for a best-effort, Linux-only hardening step. And the step is not decorative: it backs a claim the documentation makes about what another user on the same machine can read.Not a path exclusion in the rule either.
lib/services/git/**is excluded wholesale, and addingdisk_traces.dartnext to it would let a second subprocess in that file through unseen. The suppression sits on the line.Semgrep requires the
nosemgrepnote directly above the finding — eight lines of explanation in between silently does not work, which cost one round to discover. The reasoning therefore sits above the note, and the note itself is the last line before the call.The ratchet
One suppression is a judgement; ten is a habit, and then a green
make sastmeans nothing.check_conventions.dartnow counts// nosemgrep:inlib/withnosemgrepBaseline = 1.Deliberately counted there and not in semgrep:
make sastneeds an external binary and is not part ofmake check, so a new suppression would otherwise only be visible to whoever happens to have semgrep installed.Verification, four directions
make sastclean (3 rules, 667 files, 0 findings);lib/file;nosemgrep.Gates
make checkgreen.make check-secretsgreen (#522).make sastgreen. All three aggregate gates are clean on this branch — first time in this session.Principles
Weakens a security check in one named place. Weighed above: the alternative constructions are worse, the exception is line-scoped rather than file-scoped, and its growth is now itself gated.