docs(audit): codebase-wide review + live-update and search designs (LC-148) #181
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/lc-148-codebase-audit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
LC-148 codebase-wide review pass: correctness bugs, security vulnerabilities, and the deep-rooted "every new surface re-derives a concept instead of inheriting it" gaps. This is a triage + design PR (docs only); fixes are spun out as their own issues. Method: four parallel read-only analysis passes (security/authZ, correctness, live-update inventory, reused-abstraction inventory).
Deliverables (in this PR)
docs/audit/2026-05-22-lc148-audit-report.md- severity-tagged security findings (S1-S12), correctness sweep, systemic-gap matrix, prioritized backlog.docs/superpowers/specs/2026-05-22-live-updates-by-default-design.md- design for making pages live by default.docs/superpowers/specs/2026-05-22-unified-search-component-design.md- design for one reusable typeahead.Headline findings
Security (fix-first):
reactions.rshas no room-access check: any authed user can react in private rooms/DMs they can't see, inject a live WS fragment, fire the reaction webhook, and probe message existence. It's the one id-handler that skips theis_room_accessiblegate every sibling uses.unfurl.rsvalidates the host IP pre-flight but then follows redirects with no per-hop re-check, so an attacker page 302s to169.254.169.254/127.0.0.1and defeats the guard.Plus med/low: webhook delivery-time SSRF (S6), no message length cap (S9), markdown
javascript:link XSS (S8), token-CSPRNG/proxy-trust/og:image hardening (S10-12).Verified clean: SQL fully parameterized, no
| safein templates, markdown strips raw HTML, cookies/sessions/API-token handling sound, role checks re-enforced server-side, most id-handlers correctly access-checked.Systemic gaps (the main ask):
room/dm/voicesubscribe (3 copies of the same IIFE); everything else is static until reload. Design: declarativedata-lc-live+ typed topics + fill the stale surfaces.data-lc-searchcontroller.Follow-up issues filed
LC-149 (reactions authZ), LC-150 (unfurl SSRF), LC-151 (login/2FA rate limit), LC-152 (webhook SSRF), LC-153 (message length), LC-154 (markdown XSS), LC-155 (token/proxy/img hardening), LC-156 (live-updates epic), LC-157 (search epic), LC-158 (UI consolidation). LC-149/150/151 are the fix-first set.
Out of scope
Fixing the findings. This PR is the report + designs + backlog; each fix lands in its own issue/PR.
🤖 Generated with Claude Code