mirror of
https://github.com/usestrix/strix.git
synced 2026-10-13 03:57:59 +00:00
Problem:
apply_modifications() let modifications={"body": ...} replace the request
body but left the original Content-Length header untouched.
build_raw_request() only fills in Content-Length when the header is
absent, so the stale, smaller value from the original request was sent
on the wire alongside the new, larger body.
Impact:
A server reading exactly Content-Length bytes truncates the replayed
body (or stalls waiting for more), silently discarding the
modified/injected payload. This defeats parameter-tampering and
injection replays, which is the core use case of repeat_request, and
produces misleading negative results during testing.
Resolution:
When modifications["body"] is present, drop any existing Content-Length
header from the carried-over headers (matched case-insensitively),
unless the caller explicitly supplies Content-Length in this same call's
modifications["headers"]. This lets build_raw_request's existing
"fill in if absent" logic recompute the correct length from the new
body.
Testing:
Added tests/test_caido_api.py covering: stale header dropped on body
replacement, explicit caller-supplied Content-Length respected, headers
left untouched when body isn't modified, and an end-to-end check that
build_raw_request emits the recomputed length in the raw HTTP request.
Verified RED (failing on pre-fix code, reproducing the exact stale
Content-Length: 3 scenario from the bug report) before GREEN.
Resolves #603
|
||
|---|---|---|
| .. | ||
| agents | ||
| config | ||
| core | ||
| interface | ||
| report | ||
| runtime | ||
| skills | ||
| telemetry | ||
| tools | ||
| utils | ||
| __init__.py | ||