Skip to content

Add missing URI attributes to HtmlSanitizer - #940

Merged
giuscris merged 1 commit into
2.xfrom
security/add-sanitizer-missing-uri-attributes
Aug 22, 2026
Merged

Add missing URI attributes to HtmlSanitizer#940
giuscris merged 1 commit into
2.xfrom
security/add-sanitizer-missing-uri-attributes

Conversation

@giuscris

Copy link
Copy Markdown
Member

This pull request updates the list of URI attributes in the HtmlReference class to better align with HTML standards and improve security and compatibility. The main change is the expansion of the URI_ATTRIBUTES array to include additional attributes that can contain URIs.

HTML Sanitization Improvements:

  • Expanded the URI_ATTRIBUTES array in HtmlReference to include more HTML attributes that may contain URIs, such as archive, background, cite, classid, codebase, data, formaction, longdesc, manifest, poster, and usemap (formwork/src/Sanitizer/Reference/HtmlReference.php).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates HtmlReference::URI_ATTRIBUTES, which is consumed by HtmlSanitizer, to recognize additional HTML attributes as URI-bearing so they receive URI sanitization (scheme filtering / external URI handling) consistently.

Changes:

  • Expanded HtmlReference::URI_ATTRIBUTES to include additional URI-capable HTML attributes (e.g., archive, cite, classid, codebase, data, formaction, manifest, poster, usemap).
  • Reordered the URI_ATTRIBUTES list while keeping existing entries like src, href, and ping.

馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@giuscris
giuscris merged commit 628c393 into 2.x Aug 22, 2026
2 checks passed
@giuscris
giuscris deleted the security/add-sanitizer-missing-uri-attributes branch August 22, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants