Security Finding
Severity: low
Type: unsafe-pattern (uncontrolled resource consumption, CWE-409/CWE-400)
Cluster: src/pkg/dashboard/audit.go — readAuditLogFile / OutputActionsSince / auditLogFiles (disjoint from PR #4032's proxy auth cluster)
Commit 8d7c6c4 (#4854) extended OutputActionsSince to read lumberjack-rotated audit backups, including compressed .gz files. readAuditLogFile does gzip.NewReader + io.ReadAll with no size limit. auditLogFiles globs broadly (audit.jsonl.*, audit-*.jsonl.gz), so any matching file in /data is fully decompressed into memory on every activity-collector pass.
Impact
A crafted or corrupted gzip file dropped into /data (e.g. by a compromised agent container sharing the volume, or a supply-chain-tainted backup restore) can expand a few KB into many GB, OOM-killing the dashboard/hub process — a local denial of service of the control plane. Legitimate files are ≤ ~5MB (auditMaxSizeMB), so a cap costs nothing.
Recommendation
Wrap the reader in io.LimitReader with a generous cap (64MB, >10x rotation size). A truncated trailing line fails json.Unmarshal and is skipped, so behavior for legitimate files is unchanged. Fix PR: hold-gated, branch sec-check/audit-gzip-limit.
Filed by sec-check agent (ACMM L4/L5 — hold-gated mode)
🐝 Hive Agent: security | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown
— hive: agent=sec-check backend=copilot model=claude-fable-5 copilot=1.0.78
Security Finding
Severity: low
Type: unsafe-pattern (uncontrolled resource consumption, CWE-409/CWE-400)
Cluster:
src/pkg/dashboard/audit.go—readAuditLogFile/OutputActionsSince/auditLogFiles(disjoint from PR #4032's proxy auth cluster)Commit 8d7c6c4 (#4854) extended
OutputActionsSinceto read lumberjack-rotated audit backups, including compressed.gzfiles.readAuditLogFiledoesgzip.NewReader+io.ReadAllwith no size limit.auditLogFilesglobs broadly (audit.jsonl.*,audit-*.jsonl.gz), so any matching file in/datais fully decompressed into memory on every activity-collector pass.Impact
A crafted or corrupted gzip file dropped into
/data(e.g. by a compromised agent container sharing the volume, or a supply-chain-tainted backup restore) can expand a few KB into many GB, OOM-killing the dashboard/hub process — a local denial of service of the control plane. Legitimate files are ≤ ~5MB (auditMaxSizeMB), so a cap costs nothing.Recommendation
Wrap the reader in
io.LimitReaderwith a generous cap (64MB, >10x rotation size). A truncated trailing line failsjson.Unmarshaland is skipped, so behavior for legitimate files is unchanged. Fix PR: hold-gated, branchsec-check/audit-gzip-limit.Filed by sec-check agent (ACMM L4/L5 — hold-gated mode)
🐝 Hive Agent:
security| Instance:hosted-available-oke-11-placeholder-r05x| SHA:unknown— hive: agent=sec-check backend=copilot model=claude-fable-5 copilot=1.0.78