system_theme_enable() can receive user-submitted vars from either GET or POST requests, which is fine. However, $_REQUEST is a merge of $_GET, $_POST and $_COOKIE. So if someone has a cookie named 'theme' -- and, yes, I only discovered this b/c I had a cookie named theme -- it will cause havoc on the page. You won't be able to enable a theme. Or you might enable the wrong theme (if the theme cookie is set to a value that is also a theme on your site).

More about how you shouldn't use $_REQUEST when you really want a merge of just $_GET and $_POST.

http://brian.moonspot.net/2008/01/17/responsible-use-of-the-_request-var...

Patch forthcoming.

Comments

crookednumber’s picture

damien tournoud’s picture

Status: Active » Needs work

Sounds good, but at the minimum we need some comments in there, or someone might want to "fix" this down the road :)

crookednumber’s picture

Thanks, Damien. Attaching patch with comments.

crookednumber’s picture

Status: Needs work » Needs review

Forgot to change STATUS.

crookednumber’s picture

Status: Needs review » Needs work
crookednumber’s picture

Re-rolling for architecture change of 11/1/2011.

http://groups.drupal.org/node/179649

crookednumber’s picture

crookednumber’s picture

Status: Needs work » Needs review
kscheirer’s picture

kscheirer’s picture

Retesting against latest HEAD since it has been over a year.

areke’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

Sadly, half a year later, the patch no longer applies.

marvil07’s picture

Status: Needs work » Closed (won't fix)

Not sure about how Request object is built, but trusting in symfony, it seems like this patch will not be relevant anymore.
I can be wrong, please confirm and re-open if necessary.

sam hermans’s picture

Just re-rolled it, patch is no longer relevant. I confirm it can be closed.