Skip to content

Test assertions read a padded or truncated reply as a clean security verdict#728

Merged
xroche merged 3 commits into
masterfrom
fix/test-probe-masking
Jul 26, 2026
Merged

Test assertions read a padded or truncated reply as a clean security verdict#728
xroche merged 3 commits into
masterfrom
fix/test-probe-masking

Conversation

@xroche

@xroche xroche commented Jul 26, 2026

Copy link
Copy Markdown
Owner

@/tmp/claude-1000/-home-roche-git-httrack/69a76f53-3fa0-48b8-8d80-3bba01229b92/scratchpad/prbody.md

xroche and others added 3 commits July 26, 2026 19:08
Under pipefail, "request | grep -q MARKER && fail" skips the fail when the
request itself errors: the leak checks in tests 78 and 85 then pass without
ever having run. Capture the reply first and fail loudly if it never arrived.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
The previous commit converted some of the fail-open assertions and left three.
78's refusal loop still piped into "grep -q ... && fail": grep -q exits on the
first match and SIGPIPEs the producer, so under pipefail a hostile reply that
pads its Location past the 64 KB pipe buffer suppresses the failure exactly as
a dead probe would. 85's fetch() only required a non-empty reply, so a
truncated body or a 302 to the file passed the leak checks marker-free, and no
assertion looked at the status line at all. 78's store probe had no emptiness
guard, so an empty page read as "the store was not written".

Match from here-strings throughout, give fetch() the status each caller
expects, and route 78's store probe through a helper that requires a served
page. 77's X-Injected check had the same shape.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche xroche changed the title A failed request makes test 85's mirror-leak checks pass without running Test assertions read a padded or truncated reply as a clean security verdict Jul 26, 2026
@xroche
xroche merged commit 069573e into master Jul 26, 2026
22 checks passed
@xroche
xroche deleted the fix/test-probe-masking branch July 26, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant