-
Notifications
You must be signed in to change notification settings - Fork 0
Bluemonday sanitization profiles for block content #82
Copy link
Copy link
Closed
Labels
area:apiGo HTTP API serverGo HTTP API serverphase:P1-cms-corePhase 1 — CMS CorePhase 1 — CMS Corepriority:P0Critical — blocks the phaseCritical — blocks the phaseskill:goGo programmingGo programmingskill:securitySecurity expertiseSecurity expertisetype:featNew feature or implementation taskNew feature or implementation tasktype:securitySecurity-related workSecurity-related work
Milestone
Metadata
Metadata
Assignees
Labels
area:apiGo HTTP API serverGo HTTP API serverphase:P1-cms-corePhase 1 — CMS CorePhase 1 — CMS Corepriority:P0Critical — blocks the phaseCritical — blocks the phaseskill:goGo programmingGo programmingskill:securitySecurity expertiseSecurity expertisetype:featNew feature or implementation taskNew feature or implementation tasktype:securitySecurity-related workSecurity-related work
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
Configure the four
bluemondaysanitization profiles inpkg/security/sanitize/policies.goper doc 13 §4.2:CommentsUGC(extremely tight: p, br, em, strong, code, blockquote, lists, anchor with rel-nofollow),PostContent(richer authoring HTML),BlockOutput(typed backstop), andPluginOutput(matches BlockOutput; plugins cannot exceed). These power the XSS pipeline layers L2 (server render), L5 (plugin host injection), and the on-save comment sanitization.Design reference
Acceptance criteria
pkg/security/sanitize/policies.goexportsCommentsUGC(),PostContent(),BlockOutput(),PluginOutput()CommentsUGC: only p, br, em, strong, code, blockquote, ul, ol, li, a; rel-nofollow + target=_blank on external anchors; parseable URLs requiredPostContent: based onUGCPolicywith images allowed; class attr on common elements; loading attr on img; data URI images allowedBlockOutputandPluginOutputaliased toPostContentsemanticsunfiltered_htmlbypass path documented and tested (super-admin only; never for comments)Dependencies
none
Complexity
M