Drupal Finder 6.x-1.9 XSS and Remote Code Execution Vulnerabilities
Vulnerability Report
Author: Justin C. Klein Keane <justin@madirish.net>
CVE: CVE-2012-1641
OSVDB: 79014, 79015
Reported: January 6, 2012
Description of Vulnerability:
Drupal (http://drupal.org) is a robust content management system (CMS) written in PHP and MySQL. The Drupal Finder module (https://drupal.org/project/finder) "allows Drupal site administrators to create flexible faceted search forms to find entities such as nodes or users based on the values of fields and database attributes." The Finder module contains multiple vulnerabilities including persistent cross site scripting (XSS) and an arbitrary code execution vulnerability.
Systems affected:
Drupal 6.22 with Finder 6.x-1.9 was tested and shown to be vulnerable
Impact
Users can execute code with the permissions of the web server. Malicious users could inject arbitrary HTML into search results that could display to all users.
Mitigating factors:
In order to execute arbitrary code execution malicious users must have the ability to import finders. In order to execute arbitrary script injection malicious users must have the ability to create content.
Proof of Concept Exploit (Code Execution):
- Install and enable the Finder modules
- Enter '$a = phpinfo()' in the form at ?q=admin/build/finder/import
- Submit the form to view the executed code
Proof of Concept Exploit (XSS):
- Install and enable the Finder modules
- At ?q=node/add/story create a new node with the title "<script>alert('xss');</script>" and save it
- Create a new "Node finder" using the drop down at the bottom of the page ?q=admin/build/finder
- Check 'Provide block' and select "Autocomplete textfield" from the 'Add element' drop down
- Save the new finder using the button at the bottom of the form
- In the resulting configuration scree (?q=admin/build/finder/X/edit/2/edit/ where X is the Finder ID) select "Node:Title" from the 'Find items by this field:' select list and click 'Save finder element'
- Enable the new Finder block at ?q=admin/build/block
- Type 'xss' into the Finder block to view the rendered JavaScript
Vendor Response:
Upgrade to the latest version of Finder. SA-CONTRIB-2012-017