Skip to content

Stop reporting cache locations for files that do not exist - #320

Merged
RyanDFIR merged 1 commit into
mainfrom
fix-cache-location-paths
Sep 6, 2026
Merged

RyanDFIR merged 1 commit into
mainfrom
fix-cache-location-paths

Conversation

@RyanDFIR

@RyanDFIR RyanDFIR commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Cache rows named a file that has never existed. ccl's _get_location doesn't check Addr.is_initialized, so a null data address comes back as external file f_000000 at offset 0, and Chromium never allocates external file 0. On the Edge profile in cellebrite.ctf_2021 that was 9066 of 21748 locations.

Each location is now checked against what the cache directory actually holds and dropped if it doesn't resolve, which also covers a partially collected cache. Rows where nothing resolves leave the column empty, matching their <no data> summary. The column was also built by str()-ing a dict of ccl location objects, and their __repr__ is missing its closing >, so the text ran together. It's formatted here now, as metadata: data_3 @ 8192; data: f_000001.

Firefox rows carried a bare cache2 entry filename, which is the SHA-1 of the cache key and reads as a hash rather than a location. Labelled entry: <name> to match the Cache API rows in the same parser.

Also drops CacheItem.locations_str, assigned None in __init__ and never read.

Both ccl bugs are logged in future_work with repros. Suite green, no baselines moved.

The Timeline's "Data / Value / Path" column named a file that has never existed
for most Chromium cache rows. ccl's _get_location does not check
Addr.is_initialized, and a null data address reports is_initialized False while
still giving file_type EXTERNAL and file number 0, so it comes back as external
file f_000000 at offset 0. Chromium never allocates external file 0. On the Edge
profile in cellebrite.ctf_2021 that was 9066 of 21748 locations across 10874
entries; the Chrome profile beside it had 4.

A path in the output is an invitation to go and look at the file, and a phantom
one cannot be told apart from a real one, so each location is now checked against
what the cache directory actually holds and dropped if it does not resolve.
Checking presence rather than special-casing f_000000 also covers a cache
directory that was only partially collected. Entries whose locations all fail
leave the column empty, which matches their '<no data>' summary. The count is
logged per cache directory.

The column was also being built by calling str() on a dict of ccl location
objects, and CacheFileLocation.__repr__ is missing its closing '>', so the text
ran together as "...offset: 0, 'metadata': ...". It is now formatted here, as
"metadata: data_3 @ 8192; data: f_000001".

Firefox rows carried a bare 40-character cache2 entry filename, which is the
SHA-1 of the cache key and so reads as a hash rather than as the location it is.
Labelled "entry: <name>", matching the Cache API rows in the same parser.

Also drops CacheItem.locations_str, which was assigned None in __init__ and never
set or read anywhere.
@RyanDFIR RyanDFIR added the bug label Sep 6, 2026
@RyanDFIR
RyanDFIR merged commit eeaf51a into main Sep 6, 2026
18 checks passed
@RyanDFIR
RyanDFIR deleted the fix-cache-location-paths branch September 6, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant