LC-210-GREPBAN-FULLPATH: net_guard grep-ban should match allow-list by full path, not basename #285
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?
Problem
The LC-210
net_guardgrep-ban matches its allow-list by basename, diverging from the deliberate full-relative-path convention the other three grep-bans (LC-152, LC-204, LC-206) adopted specifically to defeat basename collisions. It is safe today only becausedesktop/src/is a flat directory with no subdirectories.Where
desktop/src/net_guard.rs:430- the ban iteratespath.file_name()and checks membership inBAN_ALLOWED = ["net_guard.rs", "welcome.rs"]by basename.server/tests/lc152_no_raw_reqwest_in_src.rs,lc204_no_handrolled_migrations.rs,lc206_no_raw_image_decode_in_src.rsall match full relative paths, with an inline rationale that says basename matching is intentionally avoided so a future same-basename file in a subdirectory cannot inherit the exemption.Failure mode / cost
The moment
desktop/src/grows a subdirectory, a file likefoo/welcome.rswould silently inherit the raw-ureqexemption and could construct an unguarded outbound HTTP client without the ban firing. The guard would report green while its coverage quietly shrank. Low likelihood today (flat dir), but it is a latent hole that contradicts the other three bans' stated anti-basename rationale.Proposed scope (small, fix-in-passing-sized)
net_guard.rs's ban to match the allow-list by full path relative todesktop/src(mirror the LC-152/204/206 shape), with the same inline rationale comment.ban_allow_list_entries_are_load_bearing) pointed at the same files.Acceptance
The desktop
net_guardgrep-ban matches allow-list entries by full relative path; a new same-basename file in a hypotheticaldesktop/src/<subdir>/would NOT be exempted.Anchored to LC-210 (desktop SSRF grep-ban). Severity: maintainability / latent-security; not urgent.