[Bug] make sast has been red on main since disk_traces.dart landed #521
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#521
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Describe the bug
make sastfails onmain, and has done sincelib/services/disk_traces.dartlanded. The rule
semgrep.ocideck-subproces-buiten-de-gitlaagis Blocking andfires on:
Verified against
origin/main, not just a feature branch: the line is presentthere, and a branch touching three unrelated files reproduces the failure.
Why it went unnoticed
sastis deliberately not wired intomake check(it needs an externalbinary), and there is no CI runner on this Forgejo instance. So nothing runs it
except a human following
CONTRIBUTING/the landing routine — which means aBlocking rule can sit red indefinitely while every day-to-day gate is green.
What to weigh, rather than just silence
The rule exists because a subprocess talks to the network outside NetGuard.
chmod 700on a directory the app just created is not that: it starts nonetwork-capable process and takes no user input in its arguments. Two honest
options, and the choice matters more than the fix:
chmodwith constant arguments is outside it. Then the rule is too broad and should
narrow — but narrowing a security rule by example is how deny-lists rot.
lib/services/git/is a gap — and
disk_traces.dartshould not shell out at all.Directorypermissions can be set without a subprocess on the platforms we ship.
Option 2 is the safer shape. Either way, an inline suppression with a reason is
better than loosening the pattern, and no suppression at all is better than
both if the call can simply go away.
Regression guard
Whatever the outcome, the fix needs to hold in two directions:
make sastclean on the repo, and still firing on a planted subprocess outside the git
layer. A rule that silently stops matching is worse than no rule.