Skip to content

Ensure the end marker never leaks#207

Open
jupenur wants to merge 2 commits into
mainfrom
marker-fix
Open

Ensure the end marker never leaks#207
jupenur wants to merge 2 commits into
mainfrom
marker-fix

Conversation

@jupenur

@jupenur jupenur commented Jul 9, 2026

Copy link
Copy Markdown
Member

Fixes #206. I was not able to reproduce the leak I saw in #206 and so did not find the root cause. However, this PR fixes another marker-related bug, where, if the browser canceled a script request before receiving headers (for example due to navigating away from the page that issued it), the end marker would not be produced, and WEBCAT would compute the hash for the hooks instead of the empty content. The same fix also guards against the end marker leaking: if the end marker is not seen when expected, the stream filter writes an empty body. That should fully mitigate the security impact of #206.

As for tests, test_webcat now fails without retries if a marker is ever seen in the text content.

This also fixes #208, another case related to canceled requests: when partial response content has already been received, and the request is canceled, the response is now ignored.

@jupenur jupenur requested a review from lsd-cat July 9, 2026 13:58
Base automatically changed from cache-partitioning to main July 15, 2026 12:38
@lsd-cat lsd-cat requested a review from a team July 15, 2026 12:38
@jupenur

jupenur commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

Rebased and force-pushed to get a clean diff.

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.

Partially loaded content causes integrity errors endMarker sometimes leaks into response bodies

1 participant