Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298755

Review/update $adminTags variable for new html elements to be allowed

$
0
0

Problem/Motivation

Xss::filterAdmin() is currently stripping out harmless elements (ie. the picture & source html elements that are part of the Core module Responsive Image).
$adminTags sets the elements that are allowed and would need to be updated.

This bug was first found at https://www.drupal.org/node/2687479. Views is stripping out the picture & source elements when responsive images fields are being rewritten. The patch there will be uploaded here to start / demo a fix that would need to be reviewed.

Steps to reproduce

This is for testing responsive image support (picture):

  1. Install Drupal with Umami profile
  2. Create new View: Content of type Article, Create a page, Save and edit
  3. Switch Format from Content to Fields
  4. Add a Media Image field then
    1. Choose Formatter = Rendered entity and View mode = Responsive 3x2
    2. Hide from display
  5. Add a Global: Custom text field then
    1. Include the previous Media field as a twig variable
  6. Save and look at the page

Result: See original image for the articles
Expected: See responsive image for the articles

Proposed resolution

Review/update $adminTags to include any html elements that should be allowed.

Remaining tasks

  • Verify steps to reproduce
  • Review what HTML elements to add
  • New HTML elements to be reviewed for XSS vulnerabilities
  • Provide a MR with new elements and associated tests

HTML elements to add:

User interface changes

None

API changes

None

Data model changes

None


Viewing all articles
Browse latest Browse all 298755

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>