Skip to content

Bundles: fixed zip entry times, so an export doesn't reveal the exporter's time zone - #612

Merged
LoopGlitch26 merged 1 commit into
mainfrom
agent/bundle-zip-time
Nov 5, 2026
Merged

LoopGlitch26 merged 1 commit into
mainfrom
agent/bundle-zip-time

Conversation

@LoopGlitch26

Copy link
Copy Markdown
Member

What leaked

A v2 bundle is a zip. bundle_v2.export let Python's zipfile date each entry with the exporting machine's local
clock. The records inside carry signed UTC timestamps, so anyone holding a bundle could compare the two and work out the
exporter's UTC offset, which says roughly where the person or server that exported it is. Bundles go to auditors and
other teams, so that is location data the exporter never chose to send.

The change

  • bundle_v2.zip_entry(name) dates every entry 1980-01-01 00:00, the earliest date a zip can hold. Entries are still
    deflated and still get the 0o600 attributes that writestr(name, ...) gave them. Apart from the two date fields in
    each header, an exported bundle's bytes are the same as before. I compared a bundle zipped both ways byte for byte.
  • Every v2 bundle is written by the same loop in export: single runs, run-sets, runs in parts, findings runs and
    policy snapshots. The demo's tampered copy (tracekit demo --server --keep keeps it) now uses the same entry.
  • A fixed date also makes exports reproducible: the same run exports to the same bytes wherever and whenever it is
    exported.
  • Neither verifier reads entry dates (Python tracekit/verify/v2.py, TypeScript sdk/typescript/src/verify/zip.ts), so
    old and new bundles verify the same way. docs/format-v2.md §9 now says how entries are dated.
  • v1 bundles (tracekit/bundle.py) are unchanged and still carry the local time.

Bundles already exported

They keep their dates. A new Privacy row in docs/limits.md says so and says to re-export. It also notes that v1
bundles still carry the local time.

Tests

tests/test_bundle_v2.py::TestEntryTimes sets the process time zone with time.tzset and is skipped on Windows, where
tzset doesn't exist:

  • test_every_entry_is_dated_1980_in_any_time_zone: an export made under a non-UTC TZ dates every entry
    (1980, 1, 1, 0, 0, 0).
  • test_the_same_run_exports_to_the_same_bytes: the same run exported once under UTC and once under a non-UTC zone gives
    byte-identical files, and the demo's copy of it is identical too.

Run on macOS (Python 3.11, Node 25):

  • pytest tests/test_bundle_v2.py tests/test_signer_bundles.py tests/test_verify_short.py tests/test_verify_v2_property.py tests/test_golden.py tests/test_ts_verifier.py tests/test_why_signed.py tests/test_graph.py tests/test_demos.py tests/test_docs.py: 243 passed, 590 subtests passed
  • make test-ts: 160 tests, 150 pass, 0 fail, 10 skipped (with the venv's Python first on PATH, since the tests start a real signer)
  • make lint: clean
  • make build test: twine check passed on both artifacts; 4436 passed, 394 skipped, 10 xfailed, 34556 subtests passed
  • By hand: tracekit demo --server --keep under a non-UTC TZ. zipinfo lists every entry of run.tkb and
    tampered.tkb as 80-Jan-01 00:00, deflated, mode rw-------. The TypeScript CLI (bin/tracekit.mjs verify)
    reports run.tkb VERIFIED.

…ter's time zone

A v2 export let zipfile date each entry by the local clock. Next to the
records' UTC timestamps, that date gives away the exporter's UTC offset.
Every entry is now dated 1980-01-01 00:00 with the same compression and
attributes as before, so a bundle shows nothing of the exporter's clock
and the same run exports to the same bytes. The demo's tampered copy is
written the same way. Verifiers don't read entry dates.

Bundles exported earlier keep their dates: a limits row says to re-export.
@LoopGlitch26
LoopGlitch26 merged commit 948617c into main Nov 5, 2026
34 checks passed
@LoopGlitch26
LoopGlitch26 deleted the agent/bundle-zip-time branch November 5, 2026 15:33
LoopGlitch26 added a commit that referenced this pull request Nov 6, 2026
Brings in #582 (TK-A052, TK-A053; coding pack 2026.10-v2-63), #543 (TK-C010),
#612, #595, #621 and the commits before them.

- coding.yaml: version 2026.11-v2-64, the next free one. server-17,
  strict-10, server-core-1 and dev-1 are numbers main hasn't used.
- docs/policy-v2.md: merged word by word, main's TK-A052 and TK-C010 text
  with this branch's.
- docs/evaluation.md: main's "refreshed on macOS" note with this branch's
  dev-row note.
- eval results: main's files, then E17, E21 rewrites (no --rebaseline) and
  E21 policy robustness re-run. The recorded latency rows are main's, and
  this branch's dev row (5.44 / 6.28) as before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant