GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(client-runtime): enforce the ZIP XML size limit case-insensitively by saphid · Pull Request #44492 · pingdotgg/t3code

Conversation

@saphid

@saphid saphid commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Problem

ZIP entries with uppercase or mixed-case .XML extensions (such as word/document.XML, word/Styles.Xml, ppt/slides/slide1.XML, or content.XML) bypass the 8 MiB xmlLimit guard across all four ZIP/Office archive readers (boundedZip.ts, encryptedZip.ts, officeArchive.ts, and openDocumentEncryption.ts) because each checked .endsWith(".xml") case-sensitively.

Deterministic repro on origin/main (68a67a0f20f5c768e229dbde26f4784d7d64e8b8):

Run from packages/client-runtime:

node --input-type=module -e '
import JSZip from "jszip";
import { boundedZip } from "./src/zip/boundedZip.ts";
const buf = await new JSZip().file("word/document.XML", "x".repeat(200)).generateAsync({ type: "arraybuffer", compression: "STORE" });
console.log((await boundedZip(buf, 1000, { xmlLimit: 100 })).get("word/document.XML")?.bytes.byteLength);
'
  • Observed on origin/main: boundedZip succeeds and returns the 200-byte word/document.XML entry despite xmlLimit: 100 (same for password-protected ZIPs via readEncryptedZip), while lowercase word/document.xml rejects with ZipError({ code: "archive-expanded-too-large" }). Similarly, prepareOffice(bytes, "pptx") and unlockOpenDocument(zip, "open me") bypass their 8 MiB .xml guards for uppercase .XML entries.
  • Expected: All four ZIP/Office readers reject uppercase and mixed-case .XML entries with their expanded-size error (archive-expanded-too-large / office-too-large-expanded) whenever expanded size exceeds the XML limit, while still allowing non-XML entries up to entryLimit.

Change

Lowercase the entry name/path before checking .endsWith(".xml") in all four archive readers:

  • packages/client-runtime/src/zip/boundedZip.ts (computed once per entry outside the streaming data handler) and packages/client-runtime/src/zip/encryptedZip.ts — shared by web, desktop, and mobile ZIP previews.
  • apps/web/src/components/files/officeArchive.ts (computed once per entry outside the streaming data handler) and apps/web/src/components/files/openDocumentEncryption.ts — web/desktop Office preview and encrypted OpenDocument decryption paths.

Added focused regression tests in packages/client-runtime/src/zip/boundedZip.test.ts and apps/web/src/components/files/officeArchive.test.ts covering all four paths.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • Base (68a67a0f20f5c768e229dbde26f4784d7d64e8b8) regression tests:
    • boundedZip.test.ts: failed as expected (AssertionError: promise resolved "Map{ 'word/' => { …(3) }, …(1) }" instead of rejecting).
    • officeArchive.test.ts: both new cases failed as expected (prepareOffice bypassed the 8 MiB XML guard and hit office-not-open-xml; unlockOpenDocument bypassed the 8 MiB XML guard and hit office-invalid).
  • Head (16566bf1de7fe8e52d87f0aac0f61843cbee8a85) regression tests (3 consecutive runs): vp test run packages/client-runtime/src/zip/boundedZip.test.ts apps/web/src/components/files/officeArchive.test.ts passed 24/24 tests across 2 files three consecutive times.
  • Changed checks: vp run check:changed exited 0 (format, lint, knip 1/2 & 2/2, typecheck across 7 packages, affected unit tests, and React compiler coverage).
  • Before/after runtime & test transcript: https://gist.github.com/saphid/8959f8220023e39dcadeae4d87d189cc
  • Not shown: Interactive browser/mobile UI walkthrough (no UI/copy/layout changes; all affected archive readers are verified at the unit and runtime layers) and full repo-wide test suite (delegated to CI).

Authored by Gemini 4 Neon (Antigravity); reviewed by Kimi K3.1 Pro (Model Hub).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@saphid
fix(client-runtime): enforce the ZIP XML size limit case-insensitively
407661c
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 27, 2026
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

ZIP and Office archive size checks now recognize .xml extensions regardless of letter case. Tests cover oversized uppercase XML entries in unencrypted and encrypted archives, including OpenDocument manifests.

Changes: XML archive size limits

Layer / File(s) Summary
Client-runtime ZIP limits
packages/client-runtime/src/zip/boundedZip.ts, packages/client-runtime/src/zip/encryptedZip.ts, packages/client-runtime/src/zip/boundedZip.test.ts
ZIP readers apply the XML size limit to uppercase and mixed-case extensions. Tests cover oversized uppercase XML entries in unencrypted and encrypted ZIPs.
Office archive limits
apps/web/src/components/files/officeArchive.ts, apps/web/src/components/files/openDocumentEncryption.ts, apps/web/src/components/files/officeArchive.test.ts
Office archive and OpenDocument checks apply their XML size limits regardless of extension case. Tests cover oversized uppercase .XML entries.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: yash-singh1

Merge Risk: Minimal · up to 95713

This change applies the XML expanded-size limit to uppercase and mixed-case .xml extensions in ZIP and Office archive readers. It is small, covered by regression tests, and shows no remaining merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the actual change: the ZIP XML size limit is now enforced case-insensitively in the client-runtime ZIP reader. The changeset also touches the web Office and OpenDocument readers, which…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections with concrete content. The Problem section gives a reproduction and expected behavior. The Change section…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the actual change: the ZIP XML size limit is now enforced case-insensitively in the client-runtime ZIP reader. The changeset also touches the web Office and OpenDocument readers, which the title does not mention, but the title still matches the main fix and follows the conventional commit format.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections with concrete content. The Problem section gives a reproduction and expected behavior. The Change section lists each of the four readers and explains why. Scope explains why no issue is linked. Verification gives base and head test results, the check run, and a transcript link, and it states what was not checked. The template's optional agent-model line is present. The description is detailed and mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: e4bc443
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0dd4a086-9b76-42ce-a1cb-47ee93c99958
Commits

Reviewing files that changed from the base of the PR and between 407661c and 9571302.

Files selected for processing: 1

  • packages/client-runtime/src/zip/boundedZip.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 27, 2026
juliusmarminge and others added 2 commits November 27, 2026 22:46
@juliusmarminge
Merge remote-tracking branch 'origin/main' into hunter/c-27c237c9b4
c9081a3
@juliusmarminge @claude
test(client-runtime): trim the case-insensitive xmlLimit test to one …
9571302
…regression

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge

juliusmarminge commented Nov 27, 2026

Copy link
Copy Markdown
Member

Evidence

Opened five STORE ZIPs containing identical 9 MiB XML entries through Files, unlocking encrypted copies with open me. Real web client, fresh state on each commit, light theme, 1440×1080 viewport. Base opens uppercase/mixed-case XML; head rejects every case with the expanded-archive limit error. Lowercase controls remain rejected.

Archive Before — e4bc443510 After — 9571302e96
Lowercase control Before: lowercase XML rejected After: lowercase XML rejected
Uppercase XML Before: document.XML opens at 9 MB After: uppercase XML rejected
Mixed-case XML Before: document.Xml opens at 9 MB After: mixed-case XML rejected
Encrypted lowercase control Before: encrypted lowercase XML rejected After: encrypted lowercase XML rejected
Encrypted uppercase XML Before: encrypted document.XML opens after unlocking After: encrypted uppercase XML rejected after unlocking
Recording Before interaction After interaction

Scenario file · Fixture generator

scenarios:prove exited 0: fails on base and passes on head.

Not shown:

  • Office archive and encrypted OpenDocument manifest readers were not exercised; this reproduction uses the ZIP preview paths.
  • Non-XML entry, total-size, and compression-ratio limits were not separately exercised; the fixtures isolate XML suffix case handling.
  • Desktop and mobile clients were not exercised; proof covers the web client.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 27, 2026
@juliusmarminge
juliusmarminge merged commit 73949c0 into pingdotgg:main Nov 27, 2026
60 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 27, 2026
@omegent-app omegent-app Bot mentioned this pull request Nov 28, 2026
Merge upstream main through 0f78747290a1 patroza/t3code#688
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@saphid @juliusmarminge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.