Compare commits

..
2 Commits
Author SHA1 Message Date
thuttu 0250743250 Start phase 02 on Android security implementation 2026-11-03 11:22:00 +02:00
thuttu 3d5eb5517f Tune Android UI scaling 2026-11-03 10:19:34 +02:00
10 changed files with 71 additions and 13 deletions
+1
View File
@@ -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
+1 -1
View File
@@ -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)
+2
View File
@@ -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.
+3 -3
View File
@@ -1,12 +1,12 @@
{
"name": "ep-mail",
"version": "0.5.4",
"version": "0.5.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ep-mail",
"version": "0.5.4",
"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"
},
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "ep-mail",
"version": "0.5.4",
"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"
}
+1 -1
View File
@@ -1,4 +1,4 @@
const CACHE='ep-mail-v15';
const CACHE='ep-mail-v16';
const FILES=['./','./index.html','./styles.css','./branding.css','./renderer-state.js','./mail-content-security.js','./renderer-mail-api.js','./app.js','./platform-bridge-loader.js','./platform-bridge.js','./mail-ui.js','./productivity.js','./snooze-ui.js','./account-ui.js','./dav-ui.js','./shortcuts.js','./attachments.js','./pgp-ui.js','./pgp-mail-ui.js','./manifest.webmanifest','./icon.svg','./logo-ep-daylight.svg','./logo-ep-wasteland.svg'];
self.addEventListener('install',event=>event.waitUntil(caches.open(CACHE).then(cache=>cache.addAll(FILES)).then(()=>self.skipWaiting())));
self.addEventListener('activate',event=>event.waitUntil(caches.keys().then(keys=>Promise.all(keys.filter(k=>k!==CACHE).map(k=>caches.delete(k)))).then(()=>self.clients.claim())));
+25 -2
View File
@@ -142,7 +142,7 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c}
.reader-back{display:none;border:0;background:transparent;color:var(--accent);font-size:12px;padding:5px 8px 5px 0;white-space:nowrap}
.mail-security-option input[type=checkbox]{flex:0 0 auto;width:17px;height:17px}
@media(max-width:700px){
@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){
body{min-width:320px;min-height:100dvh;overflow:hidden}
.app-shell{height:100dvh;min-height:0;flex-direction:column}
.sidebar{order:0;position:relative;width:100%;height:auto;max-height:88px;padding:5px 8px 0;border-right:0;border-bottom:1px solid var(--line);overflow:hidden}
@@ -208,4 +208,27 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c}
}
.sidebar{overflow-y:auto}#mail-nav{overflow-y:auto;min-height:150px;flex:0 1 auto;scrollbar-width:thin;align-content:start}#custom-folders{display:contents}.folders-head{flex:none}.sidebar>:not(#mail-nav){flex-shrink:0}.folders-head+.folder-nav{margin-top:0}
@media(max-width:700px){.sidebar{overflow:hidden}#mail-nav{display:flex;flex-direction:row;align-items:center;height:42px;min-height:0;max-height:42px;flex:none;overflow-x:auto;overflow-y:hidden;align-content:normal}#mail-nav .folder{height:34px;align-self:center}}
@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){
.reader-pane{overflow-x:hidden}
.reader-header,.reader-topline,.sender-row,.sender-details,.reader-body{min-width:0;max-width:100%}
.reader-subject,.reader-body,.reader-body p,.reader-body li,.reader-body a,.reader-body td,.reader-body th{overflow-wrap:anywhere;word-break:break-word}
.reader-body table{display:block;width:100%;max-width:100%;overflow-x:auto;table-layout:fixed}
.reader-body pre,.reader-body code{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}
.sender-row .message-date{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.attachment{width:100%;max-width:100%;min-width:0}
}
@media(max-height:500px) and (orientation:landscape) and (max-width:1200px){
.sidebar{max-height:72px;padding-top:3px}
.account-card{height:30px;margin-bottom:2px}
#mail-nav{height:34px;max-height:34px}
#mail-nav .folder{height:29px;padding-block:4px}
.rail{height:44px;gap:14px}
.rail-button{height:36px;width:36px}
.topbar{height:42px}
.list-heading{padding-block:6px}
.toolbar{height:32px}
.message{min-height:54px}
.list-foot{height:30px}
.reader-pane{padding-bottom:10px}
}
@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){.sidebar{overflow:hidden}#mail-nav{display:flex;flex-direction:row;align-items:center;height:42px;min-height:0;max-height:42px;flex:none;overflow-x:auto;overflow-y:hidden;align-content:normal}#mail-nav .folder{height:34px;align-self:center}}
+10 -1
View File
@@ -9,10 +9,14 @@ 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/);
assert.match(styles, /@media\(max-width:700px\)/);
assert.match(styles, /@media\(max-width:1000px\),\(max-height:500px\) and \(orientation:landscape\)/);
assert.match(styles, /@media\(max-height:500px\) and \(orientation:landscape\)/);
assert.match(styles, /overflow-wrap:anywhere;word-break:break-word/);
assert.match(styles, /\.hidden,\[hidden\]\{display:none!important\}/);
assert.match(styles, /body\.reader-open \.mail-layout \.list-pane/);
assert.match(app, /id="reader-back"/);
@@ -42,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+$/);
});
+1 -1
View File
@@ -1,4 +1,4 @@
const CACHE='ep-mail-v15';
const CACHE='ep-mail-v16';
const FILES=['./','./index.html','./styles.css','./branding.css','./renderer-state.js','./mail-content-security.js','./renderer-mail-api.js','./app.js','./platform-bridge-loader.js','./platform-bridge.js','./mail-ui.js','./productivity.js','./snooze-ui.js','./account-ui.js','./dav-ui.js','./shortcuts.js','./attachments.js','./pgp-ui.js','./pgp-mail-ui.js','./manifest.webmanifest','./icon.svg','./logo-ep-daylight.svg','./logo-ep-wasteland.svg'];
self.addEventListener('install',event=>event.waitUntil(caches.open(CACHE).then(cache=>cache.addAll(FILES)).then(()=>self.skipWaiting())));
self.addEventListener('activate',event=>event.waitUntil(caches.keys().then(keys=>Promise.all(keys.filter(k=>k!==CACHE).map(k=>caches.delete(k)))).then(()=>self.clients.claim())));
+25 -2
View File
@@ -142,7 +142,7 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c}
.reader-back{display:none;border:0;background:transparent;color:var(--accent);font-size:12px;padding:5px 8px 5px 0;white-space:nowrap}
.mail-security-option input[type=checkbox]{flex:0 0 auto;width:17px;height:17px}
@media(max-width:700px){
@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){
body{min-width:320px;min-height:100dvh;overflow:hidden}
.app-shell{height:100dvh;min-height:0;flex-direction:column}
.sidebar{order:0;position:relative;width:100%;height:auto;max-height:88px;padding:5px 8px 0;border-right:0;border-bottom:1px solid var(--line);overflow:hidden}
@@ -208,4 +208,27 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c}
}
.sidebar{overflow-y:auto}#mail-nav{overflow-y:auto;min-height:150px;flex:0 1 auto;scrollbar-width:thin;align-content:start}#custom-folders{display:contents}.folders-head{flex:none}.sidebar>:not(#mail-nav){flex-shrink:0}.folders-head+.folder-nav{margin-top:0}
@media(max-width:700px){.sidebar{overflow:hidden}#mail-nav{display:flex;flex-direction:row;align-items:center;height:42px;min-height:0;max-height:42px;flex:none;overflow-x:auto;overflow-y:hidden;align-content:normal}#mail-nav .folder{height:34px;align-self:center}}
@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){
.reader-pane{overflow-x:hidden}
.reader-header,.reader-topline,.sender-row,.sender-details,.reader-body{min-width:0;max-width:100%}
.reader-subject,.reader-body,.reader-body p,.reader-body li,.reader-body a,.reader-body td,.reader-body th{overflow-wrap:anywhere;word-break:break-word}
.reader-body table{display:block;width:100%;max-width:100%;overflow-x:auto;table-layout:fixed}
.reader-body pre,.reader-body code{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}
.sender-row .message-date{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.attachment{width:100%;max-width:100%;min-width:0}
}
@media(max-height:500px) and (orientation:landscape) and (max-width:1200px){
.sidebar{max-height:72px;padding-top:3px}
.account-card{height:30px;margin-bottom:2px}
#mail-nav{height:34px;max-height:34px}
#mail-nav .folder{height:29px;padding-block:4px}
.rail{height:44px;gap:14px}
.rail-button{height:36px;width:36px}
.topbar{height:42px}
.list-heading{padding-block:6px}
.toolbar{height:32px}
.message{min-height:54px}
.list-foot{height:30px}
.reader-pane{padding-bottom:10px}
}
@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){.sidebar{overflow:hidden}#mail-nav{display:flex;flex-direction:row;align-items:center;height:42px;min-height:0;max-height:42px;flex:none;overflow-x:auto;overflow-y:hidden;align-content:normal}#mail-nav .folder{height:34px;align-self:center}}