Skip to content

SVGZ inflate gets a trial pass, a disabled File byte cap warns, and the ECH sidecar contract states framing (BACKLOG #1129, #1125) - #2292

Merged
wshallwshall merged 2 commits into
mainfrom
b210-1129-svgz-cap
Oct 12, 2026
Merged

wshallwshall merged 2 commits into
mainfrom
b210-1129-svgz-cap

Conversation

@wshallwshall

Copy link
Copy Markdown
Collaborator

Batch 210 follow-up from a vault re-read, decided by the batch 210 Manager on 2026-10-12. It gets its own PR because it changes a security control: the SVGZ inflate.

Merge danger

Reversible: yes -- a revert undoes it all.

Blast radius: messagefoundry/api/svg_sanitize.py (_gunzip_bounded, _vet_gzip), messagefoundry/parsing/_bounded_inflate.py (docstring), messagefoundry/transports/file.py (one build-time WARNING), docs/DANGEROUS-FUNCTIONALITY.md, samples/ech-sidecar/README.md, two changelog fragments, and tests.

Behaviour changes:

  • An SVGZ attachment runs a discarding trial pass before the pass that keeps the document. An over-cap body is refused with no kept output. Small SVGZ is inflated twice, the same trial-pass cost the codec already accepts.
  • A File connector with decompress set and max_decompressed_bytes off (0, None or "0") logs one WARNING at build, naming the connection and the setting, never a value. Off without decompress logs nothing, because the cap is never read then (Manager decision).
  • The ECH sidecar contract gains a request-framing rule.

Evidence

  • Before: the SVGZ inflate bounded only during its kept pass, and the module never called the shared bounded-inflate loop. A File byte cap turned off was silent.
  • After:
    • Spy tests on bounded_inflate show a 40 MiB SVG refused with no keep_output=True call. With the bounds shrunk, an SVGZ at exactly the bound renders and one byte over is refused with no kept pass. Both spy tests fail on main.
    • A control shows a body whose head is only noise is still cleared by its first content byte.
    • Zero, None and "0" each warn exactly once; a positive cap, the default and off without decompress do not warn. The three warn cases fail on main.

Builder report (condensed). Branch b210-1129-svgz-cap, head 01a2e64d6ab4add670d611aa26282fb9066b5743, rebased onto main eb0674afb4.

wshallwshall added 2 commits October 12, 2026 13:06
…arns (BACKLOG #1129)

The SVGZ download path bounded its inflate only while keeping output,
so markup over the 32 MiB bound was refused after holding up to it.
_gunzip_bounded now walks members through the shared bounded_inflate
loop. The head sniff and the size check keep no output; a decompressor
wrapper notes the first byte past leading noise, so the not-markup
clearance is unchanged. Only an admitted body is inflated again.
Member cap and size bound unchanged.

A File inbound with decompress set and max_decompressed_bytes off
(0, None, "0") logs one warning at build, naming the connection and
the setting, never a value.
Point 4 of the sidecar contract: keep each request's Content-Length,
refuse ambiguous framing, drop the partner connection after a
misframed reply. It links to the DEPLOYMENT.md front-proxy section and
the CONFIGURATION.md forward-proxy rule rather than restating them.

Proposed PR title: SVGZ inflate gets a trial pass, a disabled File byte
cap warns, and the ECH sidecar contract states framing (BACKLOG #1129,
#1125)

Banner #1129: limb fixed, SVGZ trial pass and File cap warning.
Banner #1125: limb fixed, ECH sidecar framing clause.
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

QA (BACKLOG #1129/#1125, Builder line): code-review skill xhigh on the branch diff against origin/main before the push, applying docs/REVIEW-STANDARDS.md: no correctness defect (old and new SVGZ behaviour agree; warning wired correctly; anchors resolve; no trailers); 5 non-defect findings, 2 fixed and folded in before the push (stale _MAX_GZIP_MEMBERS comment; per-walk decompressor), 3 declined with reasons in the PR body.

@wshallwshall wshallwshall added the qa Builder QA record posted; not a merge gate label Oct 12, 2026
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: enqueueing at pinned head 01a2e64. Picked up from the batch 210 Manager's 18:15Z mail.

Review proof: the QA line (code-review skill at xhigh on the whole branch diff, applying docs/REVIEW-STANDARDS.md; no correctness defect; five non-defect findings, two fixed before the push and three declined with reasons in the PR body: the double inflate of small SVGZ, the extra full inflate for large admitted SVGZ, and the member-join copy). The declined three are cost, not behaviour, and none weakens the control. All 9 required contexts are green at this head; the one non-green check of 53 is ASVS anchors (advisory), which is not required. Merge test onto main a8b4a75 plus the queued heads of 2285 and 2286: git merge-tree exit 0, self-merge control 0.

@wshallwshall
wshallwshall added this pull request to the merge queue Oct 12, 2026
Merged via the queue into main with commit 2ca076d Oct 12, 2026
52 of 53 checks passed
@wshallwshall
wshallwshall deleted the b210-1129-svgz-cap branch October 12, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa Builder QA record posted; not a merge gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant