You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gl: uncapped success-body reads let a malicious node exhaust client memory #473
Body caps (read_body_capped, the codebase's INV-6 "reads must be bounded") are applied only on error paths (peer.rs, sync.rs, whoami.rs). Success bodies are buffered to completion with no cap: crates/git-remote-gitlawb/src/main.rs:257 (info/refs), :569 (each pack negotiation round), crates/gl/src/clone.rs:327 (resp.json()), :377 (per-envelope bytes), crates/gl/src/mcp.rs:796.
Impact
A hostile node answering a fetch, clone, or MCP call with an oversized 200 body causes full buffering and client memory exhaustion on the most basic operations. A MITM on a plaintext GITLAWB_NODE reaches the same sinks (see #413/#443 for the scheme gap).
Remediation
Apply read_body_capped (or streaming with a hard cap) to success bodies on the refs, pack, clone, and MCP paths.
Recalibrating to sev:medium. Reaching these sinks requires the operator to point gl or the remote helper at a hostile node (the plaintext-remote path is tracked separately in #413). That precondition puts it in the same band as #418 rather than the anonymously-triggerable issues. The remediation is unaffected; success bodies still need the cap.
Fixed: the refs body in mcp.rs is now read through read_body_capped_bytes with GIT_REFS_BODY_CAP.
Still uncapped on main:
git-remote-twigpine/src/main.rs: refs_resp.bytes() (info/refs) and resp.bytes() on the pack response.
twigpine-cli/src/clone.rs: .json() on the withheld-paths response, .json() on the encrypted-blobs listing, and the per-envelope .bytes() in two places.
twigpine-cli/src/mcp.rs: the success path of json_ok, which calls resp.json::<Value>() with no cap (only its error branch is capped).
The crates were renamed in #606, so the paths in the issue body are now under git-remote-twigpine and twigpine-cli.
Activity
beardthelion commentedon Sep 26, 2026
Recalibrating to sev:medium. Reaching these sinks requires the operator to point gl or the remote helper at a hostile node (the plaintext-remote path is tracked separately in #413). That precondition puts it in the same band as #418 rather than the anonymously-triggerable issues. The remediation is unaffected; success bodies still need the cap.
beardthelion commentedon Nov 17, 2026
Part of this has been fixed on main.
Fixed: the refs body in
mcp.rsis now read throughread_body_capped_byteswithGIT_REFS_BODY_CAP.Still uncapped on main:
git-remote-twigpine/src/main.rs:refs_resp.bytes()(info/refs) andresp.bytes()on the pack response.twigpine-cli/src/clone.rs:.json()on the withheld-paths response,.json()on the encrypted-blobs listing, and the per-envelope.bytes()in two places.twigpine-cli/src/mcp.rs: the success path ofjson_ok, which callsresp.json::<Value>()with no cap (only its error branch is capped).The crates were renamed in #606, so the paths in the issue body are now under
git-remote-twigpineandtwigpine-cli.