Phase 02 OpenPGP implementation

This commit is contained in:
2026-11-03 15:28:43 +02:00
parent 0250743250
commit a42774dcf1
25 changed files with 21119 additions and 162 deletions
+5 -5
View File
@@ -1,15 +1,15 @@
# Android security plan for ep-mail
Status: **Plan**. Android already has several useful protections, but it does not yet provide Android OpenPGP support, an app lock, or a release security assurance process. This document turns the remaining Android security work into an incremental plan. It is not a security certification or a substitute for an independent review.
Status: **Experimental Android OpenPGP implementation for local testing; security review and release gate remain open.** This document tracks Android protections and the remaining work. Neither the test implementation nor this plan is a security certification or a substitute for an independent review.
Related: [ENCRYPTION_PLAN.md](./ENCRYPTION_PLAN.md), [SECURITY_REVIEW.md](./SECURITY_REVIEW.md), and [TODO.md](./TODO.md).
## Implementation progress (2026-11-03)
- Implemented: explicit Android cleartext denial and backup/data-extraction exclusions; removed the wildcard Cordova origin and unused broad `FileProvider`; DAV now requires HTTPS, rejects embedded credentials/fragments, stays on the configured origin, and does not follow redirects; saved attachment names are sanitized; notification details are opt-in, stored in the encrypted vault, and redacted on the lock screen; native logs no longer expose mailbox content; debug APKs are labeled as debug and signed release builds require environment-provided signing credentials.
- Tested: DAV URL, attachment-name, and notification privacy policies have Android unit tests. The debug Android build and unit tests pass, as does the Node test suite.
- Phase 2 preparation only: OpenPGP.js is pinned to the locked 6.3.2 version. `npm audit --omit=dev` reports three moderate advisories in `ip-address` and the `nodemailer`/`mailparser` dependency chain; those dependency updates are not applied here because the suggested mailparser update is outside the current declared range and needs separate compatibility review.
- Still open: invalid-certificate integration tests, device-level review of the merged release APK, app lock/biometric unlock, full vault lifecycle testing, and Android OpenPGP. OpenPGP work remains gated on an independent cryptography/security review.
- Implemented: explicit Android cleartext denial and backup/data-extraction exclusions; removed the wildcard Cordova origin and unused broad `FileProvider`; DAV now requires HTTPS, rejects embedded credentials/fragments, stays on the configured origin, and does not follow redirects; saved attachment names are sanitized; notification details are opt-in, stored in the encrypted vault, and redacted on the lock screen; the optional native Android app lock covers the WebView, disables JavaScript bridge access while locked, and uses the device credential without blocking background sync; native logs no longer expose mailbox content; debug APKs are labeled as debug and signed release builds require environment-provided signing credentials.
- Tested: DAV URL, attachment-name, and notification privacy policies have Android unit tests. The optional app lock was exercised on an Android emulator with a device PIN, including background lock and unlock. Phone and landscape layouts were checked for horizontal overflow. The debug Android build and unit tests pass, as does the Node test suite.
- Experimental Phase 2 implementation: Android now bundles the pinned OpenPGP.js 6.3.2, stores passphrase-protected keys and public contacts in the existing Keystore-encrypted vault, supports key generation/import/export, contact trust controls, PGP/MIME encrypt/sign, and on-demand PGP/MIME or inline-message decryption. Encrypted sends are converted to ciphertext before native sending or offline queueing; decrypted content is held in renderer memory only. Android key-server lookup is disabled, and PGP/MIME messages are capped at 25 MiB on the Android test path. This test path has not had an independent human cryptography review and is not approved for sensitive or production use.
- Still open before release: independent cryptography/security review; native enforcement of trust/key-replacement and plaintext-downgrade decisions; full signed/inline-message and hostile-input parity tests; Android/GnuPG/Thunderbird interoperability; Keystore lifecycle/recovery and biometric design; invalid-certificate integration tests; device-level review of a production-signed merged APK; app-lock timeout and recovery polish; and resolution/compatibility review of the three moderate `npm audit --omit=dev` advisories in `ip-address` and the `nodemailer`/`mailparser` dependency chain.
## Goals and limits