Drupal Help Injection Module XSS Vulnerability
Description of Vulnerability:
Drupal (http://drupal.org) is a robust content management system (CMS) written in PHP and MySQL that provides extensibility through hundreds of third party modules. The Advanced Help Injection and Export Module (http://drupal.org/project/helpinject) "assists you in writing help texts suitable for use with the Advanced Help module by allowing you to write your help texts in Drupal books." The module suffers from an arbitrary HTML injection vulnerability.
Drupal 6.15 using Advanced Help 6.x-1.2 and Help Inject 6.x-1.0-alpha6 was tested and shown to be vulnerable. The Advanced Help module is a dependency, but was not tested for vulnerability.
Attackers can exploit this vulnerability to escalate privilege and take control of the web server process.
The Advanced Help and Help Inject modules must be installed and enabled. Attacker must have 'create book content' permissions in order to exploit this vulnerability. Only those with the 'inject help' permission are vulnerable, although this includes the site administrator.
Proof of concept:
- Install Drupal 6.15.
- Install Book, Advanced Help and Help Inject and enable all functionality through Administer -> Modules
- Log in as uid 0 - the admin account
- Create a book using 'Create content' -> 'Book page'
- Fill in arbitrary values for the book title
- Expand the 'Book outline' form and select '<create a new book>' from the 'Book:' select
- Save the book using the 'Save' button
- Log out and log in as a user with 'create book content' privilege
- Click 'Create content' -> 'Book page'
- Enter "<script>alert('xss');</script>" for the 'Title:' area
- Expand the 'Book outline' fieldset
- Select the book created in step 5 from the 'Book:' select item
- Click the 'Save' button
- Log out and log in as a user with privileges to 'inject help'
- Click on any of the Help Inject icons (the little plus in a gray circle)
- Click the 'Next' button on the 'path granularity' screen