You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(rules): hardcoded-secret false-positive filter drops real secrets when the line has a trailing comment containing ':' #603
is_false_positive_secret (src/engine/rules/builtin.rs) looks for the first ':' anywhere in the line and, if the text after it is a bare identifier, treats the match as an object-shorthand false positive. A real secret followed by a comment is therefore dropped:
constapi_password="hunter2hunter2xx";// note: fix later
Reproduced on v0.16.1 with cora scan (LLM unreachable): the same line without the comment is flagged, with the comment it is not. It also means any line carrying a cora-ignore: <rule> marker never produces a scanner finding, so the alias recorded by #597 for the dedup edge case never gets used in practice (the marker still works because the scanner finding is already gone, but an LLM issue on that line with its own title is not suppressed by a marker naming the scanner rule).
Direction
Only consider a ':' that is outside string literals and outside a trailing comment (or strip trailing comments, //, #, --, /* */, before the shorthand check), and require that the match itself sits in the object-literal shape. Add tests: secret + trailing comment with a colon is still flagged; { app_secret: formAppSecret } still is not.
Activity
fix(rules): judge hardcoded-secret false positives on code, not trail…