This issue has been created
There are 2 updates.
 
 
XWiki Commons / cid:jira-generated-image-avatar-7b781618-00bd-43e5-aef5-e0bb35abcd2d XCOMMONS-3866 Open

The HTML sanitizer allows the for attribute on all elements

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-62b413ae-4151-4488-ba0c-0ab56db324a7 Michael Hamann created this issue on 02/Nov/26 10:39
 
Summary: The HTML sanitizer allows the for attribute on all elements
Issue Type: cid:jira-generated-image-avatar-7b781618-00bd-43e5-aef5-e0bb35abcd2d Bug
Affects Versions: 14.6-rc-1
Assignee: Unassigned
Components: XML
Created: 02/Nov/26 10:39
Priority: cid:jira-generated-image-static-minor-cb04cf58-30b6-44d0-8466-368ee789d4fb Minor
Reporter: Michael Hamann
Description:

The secure HTML element sanitizer (used, e.g., for HTML macros written by users without script right) allows the for attribute on every element. It is only meaningful on label and output.

The declarative partial updates proposal (experimental in Chrome) gives for a new meaning on template: <template for="name"> replaces or inserts content at a marker with that name anywhere in the page, and together with src it can load the content from a remote URL. XWiki pages don't contain such markers today and the sanitizer removes processing instructions, so this has no impact currently. However, sanitized content shouldn't be able to modify parts of the page outside of it if the feature ships and markers are used.

DOMPurify, which the sanitizer is based on, removes for on all elements except label and output since version 3.4.

Steps to reproduce

  1. Create a page with the following content, as a user without script right:
    {{html}}
    <div for="x">a</div><template for="x"><p>b</p></template><label for="x">c</label>
    {{/html}}
    

Expected: for is kept only on label.
Actual: for is kept on all three elements.

 
 

2 updates

 
cid:jira-generated-image-avatar-62b413ae-4151-4488-ba0c-0ab56db324a7 Changes by Michael Hamann on 02/Nov/26 10:39
 
Fix Version: 18.10.0-rc-1
Assignee: Michael Hamann