mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Cap a report at 32 KB on both sides of the upload
The client would send up to 256 KB and the sink answered a settling 400 above 64 KB, so the two disagreed about what a valid report is, and the client deletes what it is told is invalid. Unreachable in practice — the module table and backtrace are both bounded, which puts the ceiling near 10 KB — but the two constants have to agree for the disagreement not to matter. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
committed by
majcosta
co-authored by
Claude Opus 5
parent
1d0b4beb4c
commit
c3e2d1ae3d
@@ -13,7 +13,11 @@
|
||||
// So never answer a settling 4xx for a failure on our side: that throws the report
|
||||
// away. 429 is the one 4xx that is safe, because the client does not settle it.
|
||||
|
||||
const MAX_BYTES = 64 * 1024; // reports run 2-8 KB; anything near this is not ours
|
||||
// Reports run 2-8 KB, and the fixed bounds in writeExceptionBacktrace (128
|
||||
// modules, 64 frames) cap them near 10 KB. Kept equal to kMaxReportBytes in the
|
||||
// client: anything the client is willing to send must not meet a settling 400
|
||||
// here, or the upload is what destroys the report.
|
||||
const MAX_BYTES = 32 * 1024;
|
||||
|
||||
// Every field below is lifted out of the uploaded file, and the endpoint is public
|
||||
// and unauthenticated: treat all of it as attacker-chosen, not just the handle.
|
||||
|
||||
Reference in New Issue
Block a user