AEM 6.5.5 tabindex attribute is removed by xss protection even after allowing the attribute in /apps/cq/xssprotection/config
Hi,
cc @gaurav-behl @kautuk_sahni @arunpatidar @theo_pendle
Issue: The html attribute added in source-edit mode in RTE is lost, when we save and re-open RTE for editing
Root cause: it’s removed due to XSS Antisamy Rules in AEM, not by RTE. The XSS Config exists at : /libs/cq/xssprotection/config.xml
error.logs
GET /content/foxtel/now/shop.html HTTP/1.1] org.apache.sling.xss.impl.HtmlToHtmlContentContext AntiSamy warning: The h2 tag contained an attribute that we could not process. The tabindex attribute has been filtered out, but the tag is still in place. The value of the attribute was "0".
Fix: Overlay and update xss config in apps,
1. /libs/cq/xssprotection/config.xml
We tried to overlay and uncomment the tabindex entry in the /apps/cq/xssprotection/config.xml
but that did not solve the problem in the touch ui component RTE
<attribute name="tabindex">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>
Tried this on vanila AEM 6.5 with a text v2 core component having sourceedit enabled in we-retail page. Still the tab-index attribute is not shown on the page but is present in jcr:content node.
Reference https://helpx.adobe.com/experience-manager/kb/target-attribute-issue-tag.html
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/rte-plugin-modifying-html-removing-js-functions-like-onclick/m-p/317734#M35783
Thanks @gaurav-behl have updated the question.