Opus finding
Secret scanner reads files via raw path join — no symlink/traversal protection
lowsecuritymedium
- src/ci/secrets.ts:81-94
ChangedFile.path comes from git diff but is joined to cwd without normalization. A repository containing a symlink (committed) named e.g. `link -> /etc/passwd` would, if marked changed, cause statSync to follow the symlink and readFileSync to read host system files. The scan output is then included in CI findings with file content (redacted, but raw line context). Use of statSync (follows symlinks) rather than lstatSync compounds this. Severity is low because (a) the result is only used to emit findings, not exfiltrated, and (b) attacker needs commit access; but it still represents an unintended file read.
Recommendation
Use lstatSync and skip symlinks; or resolve the realpath and reject if it escapes cwd.