On page admin/config/media/image-styles/edit/%image_style, options of select box Select a new effect are double escaped.
As a result, simple quotes are displayed like '.

Comments

anrikun’s picture

Status: Active » Needs review
StatusFileSize
new647 bytes

Patch below fixes this issue.

swentel’s picture

Status: Needs review » Needs work
StatusFileSize
new1.2 KB

The check_plain for the options is indeed redundant, however, it should be check_plain'd in the table row imo, because there's a potential (although small) issue here. Open up the image.effects.inc and change the label of image resize to this:

<script>alert(\'hi\')</script>

Select that effect and you'll see a nice javascript popup, so a potential xss issue (although small, as this requires the right permission, but still). Patch attached adds check_plain on the table row so this doesn't happen.

swentel’s picture

Status: Needs work » Needs review

Wrong status, sorry

swentel’s picture

Priority: Minor » Normal
StatusFileSize
new1.21 KB

Still valid, rerolled since it didn't apply anymore.

swentel’s picture

Assigned: Unassigned » quicksketch

Assigning to quicksketch for review

quicksketch’s picture

Looks good to me at first pass. I'll apply and test this evening. I'm guessing this affects 7.x too?

quicksketch’s picture

Status: Needs review » Reviewed & tested by the community

Select that effect and you'll see a nice javascript popup, so a potential xss issue (although small, as this requires the right permission, but still). Patch attached adds check_plain on the table row so this doesn't happen.

Agreed. This isn't an XSS hole in itself, there would need to be a module installed that specifically included an image effect that included an XSS string as an image effect label. If a module wanted to cause a ruckus though, it certainly has a lot more opportunities than XSS, since it's already running on the server anyway. ;)

Patch works as advertised, both properly escaping the image effect label when displayed in the table and not double-escaping the effect label when displayed in the "Add new effect" select list.

dries’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to 8.x. Moving it to 7.x. Thanks guys.

dcam’s picture

Assigned: quicksketch » Unassigned
Status: Patch (to be ported) » Needs review
StatusFileSize
new1.18 KB

Backported #4 to D7.

  • Dries committed d2bfb66 on 8.3.x
    Issue #1411276 by swentel, anrikun, quicksketch: Fixed image.admin.inc:...

  • Dries committed d2bfb66 on 8.3.x
    Issue #1411276 by swentel, anrikun, quicksketch: Fixed image.admin.inc:...

  • Dries committed d2bfb66 on 8.4.x
    Issue #1411276 by swentel, anrikun, quicksketch: Fixed image.admin.inc:...

  • Dries committed d2bfb66 on 8.4.x
    Issue #1411276 by swentel, anrikun, quicksketch: Fixed image.admin.inc:...
poker10’s picture

Version: 7.x-dev » 8.0.x-dev
Issue summary: View changes
Status: Needs review » Fixed

I have tested this on a clean Drupal 7.101 and it does not seems to be an issue. Closing as Fixed for D8, so that credits are assigned correctly. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.