diff --git a/ANDROID_SECURITY_PLAN.md b/ANDROID_SECURITY_PLAN.md index e5bd1f2..7473f74 100644 --- a/ANDROID_SECURITY_PLAN.md +++ b/ANDROID_SECURITY_PLAN.md @@ -8,6 +8,7 @@ Related: [ENCRYPTION_PLAN.md](./ENCRYPTION_PLAN.md), [SECURITY_REVIEW.md](./SECU - 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. ## Goals and limits diff --git a/SECURITY_REVIEW.md b/SECURITY_REVIEW.md index 801cb15..44d623d 100644 --- a/SECURITY_REVIEW.md +++ b/SECURITY_REVIEW.md @@ -63,7 +63,7 @@ Applied fixes: - Replacement-key and trust-elevation confirmation are enforced in `desktop/ipc/pgp.cjs`. `tests/pgp-ipc-registration.test.cjs` verifies both cancellation and confirmation paths for those changes. - Main-process plaintext-send confirmation is implemented in `desktop/ipc/mail.cjs`; direct regression coverage for that dialog's accept/cancel branches remains open. -- Human cryptography/security review, dependency audit and OpenPGP.js version pinning remain outstanding. GnuPG interoperability tests are in the current test suite and should be rerun after dependency changes. +- Human cryptography/security review and dependency remediation remain outstanding. OpenPGP.js is pinned to 6.3.2; `npm audit --omit=dev` currently reports three moderate advisories in `ip-address` and the Nodemailer/mailparser dependency chain. GnuPG interoperability tests are in the current test suite and should be rerun after dependency changes. - Android has no OpenPGP implementation and is outside the reviewed desktop scope. ## Third review pass (2026-10-17) diff --git a/TODO.md b/TODO.md index 4309c3c..39fe742 100644 --- a/TODO.md +++ b/TODO.md @@ -38,6 +38,8 @@ - [x] Manual interoperability check with Thunderbird. - [x] Address findings from the automated OpenPGP security reviews (see [SECURITY_REVIEW.md](./SECURITY_REVIEW.md)). - [ ] Complete an independent human security review of the encryption code before expanding OpenPGP support to Android. + - [x] Pin OpenPGP.js to the exact lockfile version while security review is pending. + - [ ] Resolve the current moderate dependency advisories reported by `npm audit --omit=dev` with compatibility tests. - [ ] Add direct IPC-handler tests for both accept and cancel paths of the main-process plaintext-send confirmation. - [ ] Complete the Android security work in [ANDROID_SECURITY_PLAN.md](./ANDROID_SECURITY_PLAN.md), including Android OpenPGP and release security checks. - [x] Make Android notification details opt-in, persist the preference in the encrypted vault, and redact lock-screen previews. diff --git a/package-lock.json b/package-lock.json index 5c176a3..cf33fec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ep-mail", - "version": "0.5.5", + "version": "0.5.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ep-mail", - "version": "0.5.5", + "version": "0.5.6", "dependencies": { "@capacitor/android": "^8.5.2", "@capacitor/core": "^8.5.2", @@ -14,7 +14,7 @@ "imapflow": "2.2.1", "mailparser": "3.9.33", "nodemailer": "10.0.9", - "openpgp": "^6.3.2", + "openpgp": "6.3.2", "tsdav": "^2.3.4", "v8-compile-cache": "^2.4.0" }, diff --git a/package.json b/package.json index 9610b15..adbb47f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ep-mail", - "version": "0.5.5", + "version": "0.5.6", "private": true, "description": "Eternity Project mail client", "homepage": "https://git.eternityproject.fi/thuttu/ep-mail-client", @@ -104,7 +104,7 @@ "imapflow": "2.2.1", "mailparser": "3.9.33", "nodemailer": "10.0.9", - "openpgp": "^6.3.2", + "openpgp": "6.3.2", "tsdav": "^2.3.4", "v8-compile-cache": "^2.4.0" } diff --git a/tests/android-ui-support.test.cjs b/tests/android-ui-support.test.cjs index f199716..6cf7a51 100644 --- a/tests/android-ui-support.test.cjs +++ b/tests/android-ui-support.test.cjs @@ -9,6 +9,8 @@ const mailUi = fs.readFileSync(path.join(root, 'mail-ui.js'), 'utf8'); const app = fs.readFileSync(path.join(root, 'app.js'), 'utf8'); const transport = fs.readFileSync(path.join(root, 'android', 'app', 'src', 'main', 'java', 'studio', 'daybreak', 'mail', 'AndroidMailTransport.kt'), 'utf8'); const mainActivity = fs.readFileSync(path.join(root, 'android', 'app', 'src', 'main', 'java', 'studio', 'daybreak', 'mail', 'MainActivity.java'), 'utf8'); +const packageJson = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')); +const packageLock = JSON.parse(fs.readFileSync(path.join(root, 'package-lock.json'), 'utf8')); test('mobile layout removes desktop minimum width and provides a compact reader flow', () => { assert.match(styles, /min-width:320px/); @@ -44,3 +46,8 @@ test('Android mail transport supports verified implicit TLS and required STARTTL test('Capacitor mail plugin is registered before BridgeActivity creates the bridge', () => { assert.ok(mainActivity.indexOf('registerPlugin(EpMailPlugin.class)') < mainActivity.indexOf('super.onCreate(savedInstanceState)')); }); + +test('OpenPGP.js is pinned to the exact version in the lockfile pending security review', () => { + assert.equal(packageJson.dependencies.openpgp, packageLock.packages['node_modules/openpgp'].version); + assert.match(packageJson.dependencies.openpgp, /^\d+\.\d+\.\d+$/); +});