Skip to content

[PM-39851] feat: Add SHA-256 integrity check for cached Fill Assist rules#2876

Draft
andrebispo5 wants to merge 1 commit into
pm-38443/consume-fill-assist-data-and-cachefrom
pm-39851/integrity-check-rules-saved-on-device
Draft

[PM-39851] feat: Add SHA-256 integrity check for cached Fill Assist rules#2876
andrebispo5 wants to merge 1 commit into
pm-38443/consume-fill-assist-data-and-cachefrom
pm-39851/integrity-check-rules-saved-on-device

Conversation

@andrebispo5

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-39851

📔 Objective

Adds a SHA-256 integrity check for the Fill Assist rules cached on device. When rules are fetched and saved, a fingerprint is computed and stored in the Keychain; when the cached rules are read (during autofill or the next sync), the fingerprint is recomputed and compared. On mismatch (or on any inconsistent absent/present combination), the tampered cache and its fingerprint are cleared, and the normal sync flow redownloads and recreates the fingerprint.

Uses a sorted-keys JSONEncoder for fingerprint computation specifically to keep the hash deterministic regardless of Dictionary iteration order (the cached rules contain nested dictionaries), verified by a dedicated round-trip regression test.

This is not a reintroduction of the SHA-256 check removed in a prior commit — that check hashed CDN-delivered content against the CDN's own untrusted cid (circular trust, no real security benefit). This fingerprint is computed and verified entirely on-device, to detect local tampering of the cached data (e.g. jailbreak/local-tamper), independent of CDN trust.

…ules

Computes and stores a Keychain fingerprint when Fill Assist rules are
cached, and verifies it whenever the cache is read. On mismatch or any
inconsistent absent/present combination, clears the tampered cache and
fingerprint so the normal sync flow redownloads and recreates them.

Uses a sorted-keys JSONEncoder for the fingerprint so it stays
deterministic regardless of Dictionary iteration order in the nested
rules structure.
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:feature labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:password-manager Bitwarden Password Manager app context t:feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant