// SECURITY AUDIT

Security Audit Report

Trust, but verify — every audit conclusion is published here.

Audit Overview

3-round review · 2026-08-18
📅 Audit dates: 2026-08-16 / 17 / 18 (three rounds)📄 Scope: all 279 .dart files in lib/ · android/ (screen-record service first full review) · docs/ · test/ (all 351 executed)🔬 Method: cross-file verification + line-by-line review + Semgrep SAST (634 rules / 510 files) + dynamic checks
0
High · all fixed
0
Medium · all fixed
0
Low · all fixed
0
Info · confirmed
0
Verified-safe designs

Verdict: converged after three rounds — attack surface cleared. Envelope encryption, hop-by-hop network checks, permission-gated sandbox and crash-safe migration held up consistently across all three rounds; newly audited areas (screen record / workflows / translation / APK packager / voice) showed no new high or medium findings; Semgrep SAST found zero hits in lib/. Ready for release.

🔧
Three rounds, all fixed: round 1 on 08-16 (all 20 sections A–T) → cross-audit on 08-17 → re-verification on 08-18. Total 2 high / 14 medium / 9 low + 4 info — all high/medium closed, remaining low fixed the same day. Details in the changelog.

Audit journey & fixes

Round 1 · 2026-08-16 (all 20 sections A–T)

High · fixed
AI chat requests followed redirects — a hijacked redirect chain could alter responses. Fixed: explicit followRedirects=false + throw on 3xx (ai_task_client.dart:27-54).
High · fixed
Clipboard sensitive data had no gate — any tool could read the clipboard. Fixed: clipboard protected by default, requires Security Center verification (security_center.dart).
Medium · fixed
SSRF variant bypass — octal / short-form / hex IPs bypassed private-range blocking. Fixed: resolveIpLiteral parses all variants + 6 unit tests (http_safe.dart:72-127).
Medium · fixed
Plugin bridge data had no size limit — a malicious plugin could exhaust memory. Fixed: 10MB storage / 50MB file caps (plugin_webview_page.dart).
Medium · fixed
Clipboard write-back during restore — restoring could pollute new data. Fixed: restorePaused mutex (backup_service.dart).
Medium · fixed
Large file copy blocked the main thread — ANR risk. Fixed: background thread + @Volatile (MainActivity.kt:1331-1343).
Low · fixed
6 low findings — password residue before lock, notification URL exposure, redundant logging; all fixed.

Round 2 · 2026-08-17 (cross-audit)

High · fixed
Translation HTML injection chain (H1) — unescaped translations went straight into the WebView. Fixed: HTML-escape translations + CSP meta script-src 'none' (plugin_webview_page.dart:411-456).
High · mitigated
tool_keys plaintext storage (H2) — plugin keys stored in plain Hive. Mitigated: outer backup-password encryption + forced export guidance (backup_page.dart:299-331).
Medium · fixed
Non-loopback http AI endpoints — project AI settings allowed plaintext endpoints. Fixed: isAllowedEndpoint enforced at global, project and request layers.
Medium · fixed
External file import overwrote existing data — severe data loss risk. Fixed: merge import for existing data + atomic replacement.
Medium · fixed
Residual plaintext entries (WebDAV / plugin bridge) — all converged to HTTPS-only or loopback whitelist.

Round 3 · 2026-08-18 (re-verification + new areas)

Passed
New audit areas: no new high/medium — screen-record service full review / workflow actions / translation chain / APK packager / voice assistant, all clean.
Low · fixed
3 low findings fixed same day — unbounded workflow delay (clamped to 10 min), translation redirect following (_postNoRedirect), failure notification URL leak (host only).
Passed
Semgrep SAST scan — 634 rules / 510 files, zero hits in lib/.
Passed
On-device verification: 10/10 passed — Huawei NAM-AL00: startup / password setup / kill-restart / clipboard gate / AppLock re-lock / share confirmation.
Passed
Dynamic checks — flutter analyze 0 errors · 351/351 tests passed · release build OK.

Confirmed Safe Designs

The following mechanisms passed cross-file verification and are confirmed safe and effective:

#MechanismVerification pathStatus
1Hive encryption key hardware protectionFlutterSecureStorage → Android Keystore / iOS Keychain
27/7 sensitive Boxes encryptedcross-checked in main.dart; sensitive boxes all opened with cipher
3Backups forcibly encryptedno password → UnencryptedBackupException
4Backup encryption algorithmPBKDF2 (300k rounds) + AES-256-GCM
5Zero logging overhead in releaseall log output inside kDebugMode
6WebDAV HTTPS enforcedHTTP configurations rejected outright
7Sandbox eval / Function disabledfull Object.defineProperty coverage
8Sandbox CSP injectionmeta tag + HTTP header dual path
9Path traversal protectionsecurity checks on plugin import and backup restore
10Other confirmed itemsbackup cipher v3, atomic restore flow, FLAG_SECURE on sensitive pages, etc.
🔬
Full report (with per-item code locations and fixes) lives in project docs/security_audit_report_2026-08-18_ZCode.md.Security is our foundation — report any issue via feedback.
MATRIX MODE: ON — enter again or press ESC to exit