Problem/Motivation

A compromised user with the restricted permission, Administer Views, can create a XSS attack for views using Grouped Filters exposed form.

Note: this is a publicly-disclosed vulnerability because it only affects a restricted permission. @kevee, see security issue #151353.

Proposed resolution

  • Filter options when displaying $group.
  • Filter options for select list options.

Remaining tasks

  • Needs work to hide no-groups?

Original report by mradcliffe

You can see this vulnerability by:
1. Enabling the module
2. As a user with Administer Views permission.
3. Create a view with exposed filters and a page display.
4. Enable the Grouped Filters exposed form on the view.
5. Add

alert('aaa');

as the name of a Group in the exposed form settings.
6. Click Apply.
7. Save the view and browse to the path for the page display.
8. The JavaScript is executed on the page

Comments

mradcliffe’s picture

Issue summary: View changes
Issue tags: +Security improvements

Forgot to add tag.

mradcliffe’s picture

Status: Active » Needs review
StatusFileSize
new2.84 KB
mradcliffe’s picture

Issue summary: View changes

Adjusted issue summary.

mradcliffe’s picture

Version: 7.x-1.0 » 7.x-2.x-dev
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs tests
StatusFileSize
new12.07 KB
new2.59 KB

It looks like I may have added some CSS to hide "no-group", but on a clean site this looks odd as No Group is in its own fieldset.

I'll need some time to look at this again.

mradcliffe’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new6.71 KB
new6.78 KB

Found the regression.

The no-group filters need to be completely outside of the $form['filters'] element. Probably a good idea to separate them anyway. This may have some breaking markup changes, but it seems to look good for me.

  • mradcliffe committed 257f588 on 7.x-2.x
    Issue #2415891 by mradcliffe, klausi: Fixes XSS vulnerability when...

mradcliffe credited klausi.

mradcliffe’s picture

Status: Needs review » Fixed

Fixed. Credited @klausi for initial review from several years ago.

Status: Fixed » Closed (fixed)

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