Widget consents survive logout, and the protected-state list misses space and call state #266

Closed
opened 2026-10-04 17:41:28 -04:00 by jared · 0 comments
Owner

1. Remembered widget approvals outlive the account
saveWidgetConsent stores lotus.widgetConsent.<roomId>.<widgetId> in localStorage (src/app/features/room/widgets/widgetUtils.ts). clearPlaintextCaches (src/app/state/plaintextCaches.ts:95-107) doesn't sweep that prefix.

If a different account signs in on the same device and opens a widget in a room both accounts share (same widget id and URL), the previous user's "allowed" grants apply silently. That includes reading decrypted messages or sending as the new user. The stored keys also leave a list of the previous user's room ids behind.

Fix: sweep lotus.widgetConsent. in clearPlaintextCaches, or key consents by user id.

2. Hardening: PROTECTED_STATE_TYPES (widgetUtils.ts:56)
These can't currently be approved for widgets, which is good: power levels, join rules, encryption, members, the widget list. Still missing:

  • m.space.child and m.space.parent: a widget could restructure a space.
  • Call state: org.matrix.msc3401.call, org.matrix.msc3401.call.member / m.call.member (a widget could fake call membership).
  • Lotus room policy state: io.lotus.voice_limit, io.lotus.room_quality.

Today these all go through the consent prompt, but it would be safer if they couldn't be approved at all.

Related: #205.

More context

Introduced by c1661e48 (2026-09-24, the widget consent prompt).

Who: shared or family computers where more than one Lotus account signs in. The stored consents also leak room ids to the next user.

Acceptance criteria

  • clearPlaintextCaches sweeps lotus.widgetConsent. (or keys include the user id).
  • PROTECTED_STATE_TYPES gains m.space.child, m.space.parent, org.matrix.msc3401.call, org.matrix.msc3401.call.member, m.call.member, io.lotus.voice_limit and io.lotus.room_quality.
  • Unit tests in widgetUtils.test.ts.

Found in the October 2026 client audit (Playwright against a local Synapse + LiveKit stack, plus code reading). Code refs are at cinny 30e2dbcd, cinny-desktop 8f67ec7, element-call 3b0050e8.

**1. Remembered widget approvals outlive the account** `saveWidgetConsent` stores `lotus.widgetConsent.<roomId>.<widgetId>` in localStorage (src/app/features/room/widgets/widgetUtils.ts). `clearPlaintextCaches` (src/app/state/plaintextCaches.ts:95-107) doesn't sweep that prefix. If a different account signs in on the same device and opens a widget in a room both accounts share (same widget id and URL), **the previous user's "allowed" grants apply silently**. That includes reading decrypted messages or sending as the new user. The stored keys also leave a list of the previous user's room ids behind. Fix: sweep `lotus.widgetConsent.` in `clearPlaintextCaches`, or key consents by user id. **2. Hardening: `PROTECTED_STATE_TYPES` (widgetUtils.ts:56)** These can't currently be approved for widgets, which is good: power levels, join rules, encryption, members, the widget list. Still missing: - `m.space.child` and `m.space.parent`: a widget could restructure a space. - Call state: `org.matrix.msc3401.call`, `org.matrix.msc3401.call.member` / `m.call.member` (a widget could fake call membership). - Lotus room policy state: `io.lotus.voice_limit`, `io.lotus.room_quality`. Today these all go through the consent prompt, but it would be safer if they couldn't be approved at all. Related: #205. ### More context **Introduced by** c1661e48 (2026-09-24, the widget consent prompt). **Who:** shared or family computers where more than one Lotus account signs in. The stored consents also leak room ids to the next user. **Acceptance criteria** - `clearPlaintextCaches` sweeps `lotus.widgetConsent.` (or keys include the user id). - `PROTECTED_STATE_TYPES` gains `m.space.child`, `m.space.parent`, `org.matrix.msc3401.call`, `org.matrix.msc3401.call.member`, `m.call.member`, `io.lotus.voice_limit` and `io.lotus.room_quality`. - Unit tests in `widgetUtils.test.ts`. --- _Found in the October 2026 client audit (Playwright against a local Synapse + LiveKit stack, plus code reading). Code refs are at cinny `30e2dbcd`, cinny-desktop `8f67ec7`, element-call `3b0050e8`._
jared added the priority: lowsecurityarea: auth-session labels 2026-10-04 17:41:28 -04:00
jared closed this issue 2026-10-19 15:18:58 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#266