Test assertions read a padded or truncated reply as a clean security verdict#728
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@/tmp/claude-1000/-home-roche-git-httrack/69a76f53-3fa0-48b8-8d80-3bba01229b92/scratchpad/prbody.md