feat(security): encrypt profile passwords at rest with AES-GCM
ci / test (push) Successful in 57s
ci / test (pull_request) Successful in 52s

Passwords are now encrypted with Web Crypto AES-GCM (256-bit) before being
stored in browser.storage.local. The random key is persisted so it survives
browser/service-worker restarts (otherwise old ciphertext could never be
decrypted). Encryption/decryption happen in the background via
encrypt-password/decrypt-password messages; autoLogin decrypts on the fly and
falls back to a legacy plaintext password for pre-encryption profiles. The
popup never reveals a stored password and preserves it when editing with a
blank field.

Removes the plaintext-password-at-rest smell flagged in the design review.
Note: this is at-rest obfuscation-level security (the key ships with the
extension); the extension only talks to the school portal.
This commit is contained in:
2026-08-20 12:27:57 +08:00
parent eb7087d506
commit 7adad7cbc8
4 changed files with 103 additions and 13 deletions
+5 -1
View File
@@ -137,7 +137,11 @@ The Study Load page gets a button row — **Download PDF**, **CSV**, **Excel**,
## Data & privacy
- Auto-login stores your portal credentials **in plaintext** on your own device.
- Profile **passwords are encrypted at rest** with Web Crypto AES-GCM (256-bit).
The key lives in `browser.storage.local` so it survives restarts. This removes
the plaintext-password smell from storage; it is NOT strong protection against
an attacker who can read both the storage and the extension source — this
extension only talks to the school portal, never any third-party server.
- This is a personal-use helper for the university portal; use it only with your
own account.