Drupal Panels Module XSS Vulnerability
Description of Vulnerability:
Drupal (http://drupal.org) is a robust content management system (CMS) written in PHP and MySQL. The Drupal Panels module (http://drupal.org/project/panels) "allows a site administrator to create customized layouts for multiple uses. At its core it is a drag and drop content manager that lets you visually design a layout and place content within that layout." Unfortunately the Panels module contains an arbitrary HTML injection vulnerability (also known as cross site scripting, or XSS) due to the fact that it fails to sanitize div classes and id specifications for panels before display.
Systems affected:
Drupal 6.19 with Panels 6.x-3.7 was tested and shown to be vulnerable
Impact
User could inject arbitrary scripts into pages affecting site users. This could result in administrative account compromise leading to web server process compromise. A more likely scenario would be for an attacker to inject hidden content (such as iframes, applets, or embedded objects) that would attack client browsers in an attempt to compromise site users' machines. This vulnerability could also be used to launch cross site request forgery (XSRF) attacks against the site that could have other unexpected consequences.
Mitigating factors:
In order to exploit this vulnerability the attacker must have credentials to an authorized account that has been assigned the 'use page manager' and 'administer advanced pane settings' permissions. This could be accomplished via social engineering, brute force password guessing, or abuse or legitimate credentials.
Proof of concept:
- Install Drupal 6-19, Panels 6.x-3.7 and Ctools module (a prerequisite)
- Enable the Panels module and the page manager in Ctools from ?q=/admin/build/modules
- Administer panels from ?q=/admin/build/panels and click on the 'Panel page' link on the left
- Check 'Make this your site home page' and fill in arbitrary values for the rest
- In the resulting screen (?q=admin/build/pages/add/page-[page_name]/next) select the 'Flexible' and 'Builders' from the Category drop down
- Click continue
- Enter arbitrary values in the resulting form
- Click finish then 'Update and save'
- In the Panel Content designer (?q=admin/build/pages/nojs/operation/page-[page_name]/handlers/page_[page_name]_panel_context/content click the gear in the 'Center' region
- Select 'Add content'
- Select 'Existing node' and enter the nid of an existing node.
- Click the gear to the right of the header in the new box preview of the node
- Select 'CSS Properties'
- In the shadow box that pops up enter '"><script>alert('xss1');</script><div id="' for the 'CSS ID'
- Enter '"><script>alert('xss1');</script><div id="' for the 'CSS class'
- Click 'Update and preview' to observe the Javascript alerts
- Click 'Save' to store these values so they are displayed on the home page
Vendor Response
Upgrade to the latest version of Panels (Ref: SA-2011-02)