Skip to content

fix(fixture): redact device identifiers from shared bundles - #66

Merged
renezander030 merged 2 commits into
masterfrom
fix/59-redact-device-identifiers
Aug 9, 2026
Merged

renezander030 merged 2 commits into
masterfrom
fix/59-redact-device-identifiers

Conversation

@renezander030

Copy link
Copy Markdown
Owner

Closes #59.

capcut fixture is documented as producing a shareable bundle and the generated README tells users to attach it to a public issue — but the redactor only handled home paths and emails. device_id, mac_address and hard_disk_id were copied verbatim, so the documented flow published a stable device ID and MAC to a public repo. SANITIZE_REPORT.json compounded it by writing source_dir/out_dir raw, reintroducing the username the timeline files had just had scrubbed.

Approach

Keyed on the field name, not the value shape — device_id and mac_address are plain 32-hex, so a bare /[0-9a-f]{32}/ would also blank legitimate material and segment UUIDs. Handles the escaped-quote form template-2.tmp uses for its string-JSON. Matches only non-empty values, so an already-blank hard_disk_id is not counted as a removal. Keys are preserved with empty values — the on-disk shape is what a fixture is for.

app_id is deliberately left alone: it identifies the app, not the machine, and nothing in src/ reads it. Happy to include it if you'd rather.

Tests

Four new cases: plain and escaped forms, a sweep asserting no identifier survives in any emitted file (report and README included), report path redaction, and an exact redaction count that proves the blank hard_disk_id is not over-reported.

651 tests pass, biome clean.

/cc @scornik — this is the fix your 8.5.0 bundle was waiting on.

capcut fixture is documented as producing a shareable bundle and the
generated README invites attaching it to a public issue, but the redactor
only ever handled home paths and email addresses. The device_id,
mac_address and hard_disk_id that CapCut stamps into every platform and
last_modified_platform block were copied verbatim into draft_info.json,
template-2.tmp and every nested timeline document, so following the
documented flow published a stable device ID and MAC address.

SANITIZE_REPORT.json compounded it: source_dir and out_dir were written
raw, reintroducing the username the timeline files had just had scrubbed.

The new redactor keys on the field name rather than the value shape —
device_id and mac_address are plain 32-hex, so a bare hex pattern would
also blank legitimate material and segment UUIDs. It matches the escaped
quote form template-2.tmp uses for its string-JSON, and only non-empty
values, so an already-blank hard_disk_id is not reported as removed. Keys
are kept with empty values because the on-disk shape is the point of a
fixture. app_id is deliberately left alone: it identifies the app, not the
machine, and nothing in src/ reads it.

Closes #59
The new tests synthesised a /home/<user>/ prefix so the report's source_dir
had something for the path redactor to catch. On Windows join() produces
...\home\secretuser\..., which the POSIX linux_user pattern cannot match,
so the windows-latest smoke failed.

Production was never affected: a real Windows project lives under
C:\Users\<name>\, which windows_user already covers. The synthetic prefix
was the only thing unredacted.

Windows now asserts against the real account name from tmpdir() instead —
that path is genuinely C:\Users\<user>\AppData\..., so the platform that
exposed the gap ends up exercising the production shape rather than a
synthetic one. The username assertions are skipped only if tmpdir() is not
under a Users\ root at all.
@renezander030
renezander030 merged commit 07920ab into master Aug 9, 2026
8 checks passed
@renezander030
renezander030 deleted the fix/59-redact-device-identifiers branch August 9, 2026 10:20
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.

fixture: bundles are not safe to share — device_id / mac_address are never redacted

1 participant