While using a custom template file, using $title variable caused an XSS vulnerability.

Suggesting this patch to prevent it from happening elsewhere.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Moo64c created an issue. See original summary.

Moo64c’s picture

drunken monkey’s picture

Thanks for reporting this problem!
While I'm pretty sure yours is the correct way to do this (I'm unfortunately not very good with the theming layer), I'm not sure whether we can easily introduce such a change in this part of the code at this point. After all, this might break the code of other people who are overriding this template. (And, unfortunately, nobody reads release notes, as you are probably aware.) So, before really changing this, I'd at least need feedback from other people who would be in favor of this change.

What we should in any case do, though, is more clearly documenting that the $title variable is unsanitized.

(Also, in case we do change the variables, we should probably take the opportunity to fix the variable list in hook_theme().)

  • drunken monkey committed 5314d43 on 7.x-1.x
    Issue #2592143 by drunken monkey: Improved template documentation to...
drunken monkey’s picture

Status: Needs review » Fixed

Would have been great to get further feedback, but I guess a one-line comment change patch can also not really break anything.
So, committed. Please re-open if you have any other suggestions.

Status: Fixed » Closed (fixed)

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