ID: SUM-SEC-12
Wave: P1
Severity: Medium
Labels: security, bypass, acl, P1, medium
Branch: fix/SUM-SEC-12-elevated-bypass-audit-lint
Languages: Go
Related: SUM-PLAT-03 (API shape / product)
CWE: CWE-250
Summary
ContextWithBypass is unscoped and largely unaudited. Web layer does not set it on requests today (good). Addon hooks (automation, digest), scheduler, outbox, module sync elevate silently. Foot-gun: wrapping r.Context() with bypass skips ACL/rules/field ACL for the whole request. superuserUID = 1 is a second total bypass path.
Acceptance criteria
Files to check / change
sumeru/core/orm/security_context.go
sumeru/core/orm/security_const.go
- Callers:
setup_handlers.go, module/*, scheduler.go, outbox_drain.go, addons/automation/hooks.go, addons/digest/hooks.go, apikey.go
ID: SUM-SEC-12
Wave: P1
Severity: Medium
Labels: security, bypass, acl, P1, medium
Branch:
fix/SUM-SEC-12-elevated-bypass-audit-lintLanguages: Go
Related: SUM-PLAT-03 (API shape / product)
CWE: CWE-250
Summary
ContextWithBypassis unscoped and largely unaudited. Web layer does not set it on requests today (good). Addon hooks (automation, digest), scheduler, outbox, module sync elevate silently. Foot-gun: wrappingr.Context()with bypass skips ACL/rules/field ACL for the whole request.superuserUID = 1is a second total bypass path.Acceptance criteria
WithElevated(ctx, reason, fn)with audit event (actor, reason, models touched if feasible)ContextWithBypassoutside allowlistedcore/packages; never on HTTPr.Context()in handlersFiles to check / change
sumeru/core/orm/security_context.gosumeru/core/orm/security_const.gosetup_handlers.go,module/*,scheduler.go,outbox_drain.go,addons/automation/hooks.go,addons/digest/hooks.go,apikey.go