ID: SUM-SEC-20
Wave: P2
Severity: Low
Labels: security, rpc, orm, P2, low
Branch: fix/SUM-SEC-20-rpc-content-type-upsert-rules
Languages: Go, TypeScript (SWC note only)
Summary
- RPC accepts empty
Content-Type as JSON — loosens CSRF/browser quirks surface.
- ORM
Upsert skips CheckRecordRules (intentional). Safe only if never reachable from authenticated RPC; needs assert/guard.
- SWC
t-out / t-raw are XSS sinks if fed user HTML — prefer t-esc in mail/chatter templates (hardening note).
Acceptance criteria
Files to check / change
sumeru/core/server/web/rpc_json.go (~L87–89)
sumeru/core/orm/crud_insert.go (Upsert)
sumeru/core/server/web/auth_helpers.go (JSON encode escape)
sumeru/core/swc/src/template/sum/codegen.ts (t-out / t-raw — documentation / review)
ID: SUM-SEC-20
Wave: P2
Severity: Low
Labels: security, rpc, orm, P2, low
Branch:
fix/SUM-SEC-20-rpc-content-type-upsert-rulesLanguages: Go, TypeScript (SWC note only)
Summary
Content-Typeas JSON — loosens CSRF/browser quirks surface.UpsertskipsCheckRecordRules(intentional). Safe only if never reachable from authenticated RPC; needs assert/guard.t-out/t-raware XSS sinks if fed user HTML — prefert-escin mail/chatter templates (hardening note).Acceptance criteria
application/json(or documented charset variants) on/api/rpct-outon untrusted user content in addonsSetEscapeHTML(true)on API JSON encodersFiles to check / change
sumeru/core/server/web/rpc_json.go(~L87–89)sumeru/core/orm/crud_insert.go(Upsert)sumeru/core/server/web/auth_helpers.go(JSON encode escape)sumeru/core/swc/src/template/sum/codegen.ts(t-out / t-raw — documentation / review)