Area
frontend/src/lib/notes.ts, frontend/src/lib/kyc.ts
Problem
saveNote/markNoteSpent/saveKyc store bearer-spendable notes and KYC preimages as plain unencrypted JSON in localStorage (read-modify-write via getNotes() → mutate → JSON.stringify → setItem), with no schema/version field and no encryption at rest. Any XSS, a malicious browser extension, or anyone with brief access to the device can read every spendable note verbatim. The read-modify-write is also not atomic: two tabs/windows performing a deposit and a withdraw concurrently can race, with the last setItem silently winning and dropping the other tab's note or spent-flag update.
Proposed change
Short term: document this as a known limitation (README/SECURITY.md — "don't use DShield on a shared/public device; notes are stored in plaintext in your browser") and add a storage event listener or simple lock to serialize cross-tab writes so concurrent tabs don't silently drop each other's updates. Longer term (separate follow-up): consider a passphrase-derived encryption layer for the note store.
Acceptance Criteria
Open your PR against the dev branch, not main. All active development merges into dev.
Discuss this issue / coordinate work: join the DShield contributor Telegram group: https://t.me/+SiGHH24No9U2MDJk
Area
frontend/src/lib/notes.ts, frontend/src/lib/kyc.ts
Problem
saveNote/markNoteSpent/saveKycstore bearer-spendable notes and KYC preimages as plain unencrypted JSON inlocalStorage(read-modify-write viagetNotes()→ mutate →JSON.stringify→setItem), with no schema/version field and no encryption at rest. Any XSS, a malicious browser extension, or anyone with brief access to the device can read every spendable note verbatim. The read-modify-write is also not atomic: two tabs/windows performing a deposit and a withdraw concurrently can race, with the lastsetItemsilently winning and dropping the other tab's note or spent-flag update.Proposed change
Short term: document this as a known limitation (README/SECURITY.md — "don't use DShield on a shared/public device; notes are stored in plaintext in your browser") and add a
storageevent listener or simple lock to serialize cross-tab writes so concurrent tabs don't silently drop each other's updates. Longer term (separate follow-up): consider a passphrase-derived encryption layer for the note store.Acceptance Criteria
just test,pnpm test,cargo test, ornargo testas applicable) pass locally and in CIOpen your PR against the
devbranch, notmain. All active development merges intodev.Discuss this issue / coordinate work: join the DShield contributor Telegram group: https://t.me/+SiGHH24No9U2MDJk