Repository navigation
Bundles: fixed zip entry times, so an export doesn't reveal the exporter's time zone - #612
Merged
Merged
Conversation
…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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What leaked
A v2 bundle is a zip.
bundle_v2.exportlet Python'szipfiledate each entry with the exporting machine's localclock. 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 stilldeflated and still get the
0o600attributes thatwritestr(name, ...)gave them. Apart from the two date fields ineach header, an exported bundle's bytes are the same as before. I compared a bundle zipped both ways byte for byte.
export: single runs, run-sets, runs in parts, findings runs andpolicy snapshots. The demo's tampered copy (
tracekit demo --server --keepkeeps it) now uses the same entry.exported.
tracekit/verify/v2.py, TypeScriptsdk/typescript/src/verify/zip.ts), soold and new bundles verify the same way.
docs/format-v2.md§9 now says how entries are dated.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.mdsays so and says to re-export. It also notes that v1bundles still carry the local time.
Tests
tests/test_bundle_v2.py::TestEntryTimessets the process time zone withtime.tzsetand is skipped on Windows, wheretzsetdoesn't exist:test_every_entry_is_dated_1980_in_any_time_zone: an export made under a non-UTCTZdates 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 givesbyte-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 passedmake 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: cleanmake build test:twine checkpassed on both artifacts; 4436 passed, 394 skipped, 10 xfailed, 34556 subtests passedtracekit demo --server --keepunder a non-UTCTZ.zipinfolists every entry ofrun.tkbandtampered.tkbas80-Jan-01 00:00, deflated, moderw-------. The TypeScript CLI (bin/tracekit.mjs verify)reports
run.tkbVERIFIED.