what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Drupal 7.22 / 6.28 Cross Site Scripting

Drupal 7.22 / 6.28 Cross Site Scripting
Posted Aug 14, 2013
Authored by Justin C. Klein Keane, Greg Knaddison

Drupal versions 7.22 and 6.28 suffer from cross site scripting vulnerabilities.

tags | exploit, vulnerability, xss
SHA-256 | e04775da7a9ee6e34c96ad35efc7a981fa752926363c46cfdef6ebd1d28e355d

Drupal 7.22 / 6.28 Cross Site Scripting

Change Mirror Download
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

NB: Before anyone gets their panties in a twist read the whole
disclosure, this isn't the end of the world, sky-is-falling
vulnerability you might be looking for, but I do believe it is
serious. TLDR: check your .info files!

Vulnerability Report

Author: Justin C. Klein Keane <justin@madirish.net>
Reported: 7 August, 2013

Description of Vulnerability:
- -----------------------------
Drupal (http://drupal.org) is a robust content management system (CMS)
written in PHP and MySQL. Drupal core suffers from multiple
persistent (stored) cross site scripting (XSS, or arbitrary script
injection) vulnerabilities because the core System module, included in
all Drupal sites, fails to sanitize module names and descriptions
provided in module metadata files (identified by their .info
extension) before display in some locations.

Systems affected:
- -----------------
Drupal 7.22 and 6.28 were tested and shown vulnerable. Other versions
are likely affected.

Impact
- ------
Attackers can inject arbitrary HTML (including JavaScript) in order to
attack site administrators. This could lead to account compromise
(which could in turn lead to arbitrary PHP code execution privileges),
or expose administrative users to client side malware attacks.

Mitigating factors:
- -------------------
In order to inject arbitrary script malicious attackers must have the
ability to manipulate module .info files on a site filesystem, perhaps
via permissions misconfiguration, or to manipulate these files in
modules before they are deployed to a site, such as with the Features
module (https://drupal.org/project/features). It would be quite rare
to be able to manipulate a .info file without the ability to
manipulate actual PHP code contained in modules. However, malicious
script contained in .info files would likely be overlooked in any
security audit since these files are assumed to be inert text files,
devoid of any scripting, markup, or executable code. It is worth
noting that the content of .info files is sanitized for display in
some locations, but this treatment is not uniform. Thus the
likelihood of an attack via this vector is LOW, but the impact is
extremely high, and the attack would likely escape notice by most
automated and manual security countermeasures.

Proof of Concept Exploits:
- -----------------
1. Install Drupal 7-22
2. Create a new directory in the /sites/all/modules named "evil"
3. Create the file evil.info in the /sites/all/modules/evil directory
to include the following content:
name = <script>alert('evil name');</script>
description = <script>alert('evil desc');</script>
core = 7.x
package = Other
version = 7.x-1.0
project = evil_feature
dependencies[] = system

4. Create the file evil.module in the /sites/all/modules/evil
directory to include the following contents:
<?php
/**
* @file
* Drupal needs this blank file.
*/

5. Navigate to the Modules administration screen at ?q=admin/modules
to view the rendered JavaScript alerts
6. Note that the listing of the evil module name under the System
module is properly sanitized

Patch:
- -------------
The following patch mitigates this vulnerability in Drupal 7:

- --- modules/system/system.admin.inc 2013-04-03 17:29:52.000000000 -0400
+++ modules/system/system.admin.inc 2013-08-07 10:47:29.277279676 -0400
@@ -979,10 +979,10 @@ function _system_modules_build_row($info
);
// Set the basic properties.
$form['name'] = array(
- - '#markup' => $info['name'],
+ '#markup' => check_plain($info['name']),
);
$form['description'] = array(
- - '#markup' => t($info['description']),
+ '#markup' => t("@desc", array('@desc' => $info['description'])),
);
$form['version'] = array(
'#markup' => $info['version'],


Vendor Response:
- ----------------
The Drupal Security Team considers this vulnerability worthy of public
discussion. The team points out that an attacker able to manipulate a
.info file would likely be able to manipulate PHP code found in other
files in the same directory. Furthermore, the Drupal Security Team
feels this issue is already public (https://drupal.org/node/637538),
however the public discussion only concerns the development of the
next major release of Drupal - Drupal 8. There is no mention in the
public discussion, of the fact that this issue faces both current
supported release versions (Drupal 7 and Drupal 6) and likely previous
releases.

- --
Justin C. Klein Keane
http://www.MadIrish.net

Any digital signature on this message can be confirmed using
the GPG key at http://www.madirish.net/gpgkey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iPwEAQECAAYFAlILhzQACgkQkSlsbLsN1gDJjgb+MFQ5xee1G5zfZ25T2jpMLztb
Y/UFjB068iAytm6ogTg35Iyz9y/aBNapPvVLCMRy8rmYtywJIpORy6Jxnwsyxxq+
Lkf3SeXXGHG1V7gDSVtt+H+SDtpRS3aqYigYVb+Ia6tlkfb2IR7dBdUWCVuT3789
Qf2NPbVqdxvn2xHVGItnto1qKfqd4AqssATtBoe/hdE/ti7QOgQmxg7yA9fi4KBU
uhdd6Skq8ZLsbacFSA45jpT9QRJPnQt6tWWiF7ePU/e/xZjrIUZZWHDHTHo8ntpk
fQVjZlI7cOwojrP9sd0=
=rilD
-----END PGP SIGNATURE-----

----------------------------------------------------------------
Date: Wed, 14 Aug 2013 08:00:39 -0600
From: Greg Knaddison <greg.knaddison@gmail.com>
To: "Justin C. Klein Keane" <justin@madirish.net>
Cc: full-disclosure@lists.grok.org.uk

Thanks to Justin for identifying and describing this issue.

With a little more detail inline.

On Wed, Aug 14, 2013 at 7:33 AM, Justin C. Klein Keane
<justin@madirish.net> wrote:
<snip>
> Mitigating factors:
> - -------------------
> In order to inject arbitrary script malicious attackers must have the
> ability to manipulate module .info files on a site filesystem, perhaps
> via permissions misconfiguration,

It feels unclear to me if the permissions mentioned here are Drupal
permissions or others. So, to be clear, this would require server file
permission misconfiguration. The info files are placed in the same
directories as php code. For this vulnerability to be significant it
would require permissions like:

-rw-rw-rw- 1 deployuser deployuser 243 Jan 7 2013 machine_name.info
-rw-rw-r-- 1 deployuser deployuser 434 Jan 7 2013 machine_name.install
-rw-rw-r-- 1 deployuser deployuser 3802 Jan 7 2013 machine_name.module

Or maybe:

-rw-rw-r-- 1 deployuser somegroup 243 Jan 7 2013 machine_name.info
-rw-r--r-- 1 deployuser somegroup 434 Jan 7 2013 machine_name.install
-rw-r--r-- 1 deployuser somegroup 3802 Jan 7 2013 machine_name.module

In the first scenario the attacker would just need a shell on the
server. In the second scenario the attacker would need a shell on the
server and membership in somegroup.

<snip>

> feels this issue is already public (https://drupal.org/node/637538),
> however the public discussion only concerns the development of the
> next major release of Drupal - Drupal 8. There is no mention in the
> public discussion, of the fact that this issue faces both current
> supported release versions (Drupal 7 and Drupal 6) and likely previous
> releases.

I updated that issue to include Drupal 7 and Drupal 6 mentions.

It's true this affects previous releases, but previous releases are
explicitly EOL and full of holes that are not documented.
* Drupal 5 EOL Announcement: https://drupal.org/node/1027214
* Drupal 4.7 EOL Announcement: https://drupal.org/node/225729

Regards,
Greg

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close