Skip to content

fix(security): duress PIN review fixes, tests and privacy notes - #136

Merged
pasichDev merged 2 commits into
mainfrom
chore/duress-docs-tests
Nov 21, 2026
Merged

pasichDev merged 2 commits into
mainfrom
chore/duress-docs-tests

Conversation

@pasichDev

Copy link
Copy Markdown
Owner

What

  • PRIVACY.md: what the duress PIN and the decoy vault keep on the device.
  • Tests: duress PIN set-up and change killed at each step; an unlock interrupted by an OS lock (lock request, keyguard, screen off, background) for the real and the duress PIN; saves, purges and backup steps that finish after a vault switch; 15 and 30 minute auto-lock across process death, the alarm and a device lock.
  • Fixes from a security review of the duress flow:
    • the decoy vault keeps its own trash purge time, so its unlocks cannot use up the real vault's purge allowance;
    • deleting the decoy database is checked; turning the duress PIN off or setting a new one fails if a file stays;
    • in the decoy vault a refused PIN change runs the same KDF step as the real vault;
    • a screen that goes off and on during the PIN check counts as a lock request (an insecure keyguard let that unlock through).
  • SECURITY.md: "What an observer can and cannot tell", the pin.strikes tell as it really lasts, the fingerprint behaviour in the decoy vault as a known tell.

Why

#131: the duress PIN shipped without its PRIVACY.md text, these tests or a recorded review.

Testing

Local: :core:security, :core:database, :shared host tests, :app:testPlayDebugUnitTest, detekt, spotless, ABI checks. Each fix has a test that fails without it.

Not verified: on a device; a really truncated first SQLCipher creation; screen-off after Android froze the process.

References

Closes #131.

…auto-lock

- PRIVACY.md: what the duress PIN and the decoy vault keep on the device.
- Duress PIN set-up and change killed at each step: the real vault
  always opens, the duress PIN works fully or not at all.
- An unlock interrupted by an OS lock (lock request, keyguard, screen
  off, background) ends locked, for the real and the duress PIN.
- A save, purge or backup step started in one vault and finishing after
  a switch never writes into the other.
- 15 and 30 minute auto-lock across process death, the alarm and a
  device lock.

Refs: #131
- The decoy vault keeps its own trash purge time, so unlocks of it with
  a clock set forward can no longer use up the real vault's allowance
  and empty its trash at once.
- Deleting the decoy database is checked: turning the duress PIN off or
  setting a new one fails if a file stays, instead of reporting success
  and later opening a stale file.
- In the decoy vault a refused PIN change runs the same KDF step as the
  real vault, so it is not answered instantly.
- A screen that goes off and on while the PIN is still being checked
  counts as a lock request, so an insecure keyguard no longer lets that
  unlock through.
- SECURITY.md: what an observer of the device can and cannot tell, the
  pin.strikes tell as it really lasts, and the fingerprint behaviour in
  the decoy vault as a known tell.

Refs: #131
@pasichDev pasichDev self-assigned this Nov 21, 2026
@github-actions

Copy link
Copy Markdown

Coverage

Overall Project 85.52% 🍏

There is no coverage information present for the Files changed

@pasichDev
pasichDev merged commit db0e09f into main Nov 21, 2026
13 checks passed
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.

Duress PIN and auto-lock: document the decoy in PRIVACY.md and test process death and OS lock

1 participant