fix: four validation/correctness audit findings (LC-355, LC-357, LC-358, LC-359) #369
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/lc-355-357-358-359-audit-med"
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?
The four quick validation/correctness MED findings from the UI audit.
just testandjust test-saasboth green; 5 new regression tests.LC-355 - branding login text not capped (LC-153)
parse_branding_multipartstoredlogin_heading/login_bodyunbounded; bounds were client-only.login_bodyis markdown-rendered on the PUBLIC/loginpage, so a forged multipart is an uncapped per-pageload render on an unauthenticated route. Cap at 120 / 2000 chars, inline error via the parser's existingOk(Err)contract. Test: over-long body re-renders with the error and does not persist.LC-357 - bridge/webhook targets unvalidated
post_bridgesandpost_outgoing_webhooksnever checkedroom_id/scope_idexisted (or, for bridges, was non-DM). Validate the room/enclave exists before acting; the bridge check runs before the bot is minted so a bad room can't orphan a bot + token. Tests: bridge and webhook to a nonexistent target re-render inline and create nothing.LC-358 - site-wide rate-limit/quota unbounded
rate_limit_messagesandquota_mibhad no ceiling (the per-enclave burst is capped at 10000). Clamprate_limit_messagesto 10000, rejectquota_mibabove 16 TiB, matchingmax=on both inputs. Tests: 99999 clamps to 10000; an over-max quota 400s and doesn't persist.LC-359 - multiline message edit
The inline edit form was a single-line
<input>, clipping multiline messages to their first line. Swap for a<textarea>(field name unchanged); Escape cancels, Ctrl/Cmd+Enter saves so Enter inserts a newline.Closes LC-355, LC-357, LC-358, LC-359.