what you don't know can hurt you

Drupal 6.22 / SuperCron 6.x-1.3 Cross Site Scripting

Drupal 6.22 / SuperCron 6.x-1.3 Cross Site Scripting
Posted Dec 22, 2011
Authored by Justin C. Klein Keane

Drupal version 6.22 with SuperCron version 6.x-1.3 suffers from a cross site scripting vulnerability.

tags | exploit, xss
MD5 | 8de5defe9193f6b1a764c7c7e8649b44

Drupal 6.22 / SuperCron 6.x-1.3 Cross Site Scripting

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

Description of Vulnerability:
- -----------------------------
Drupal (http://drupal.org) is a robust content management system (CMS)
written in PHP and MySQL. The Drupal SuperCron module
(https://drupal.org/project/supercron), created by 63 Reasons
(http://www.63reasons.com/), "is a complete replacement for Drupal's
built-in Cron functionality." The SuperCron module contains a
persistent arbitrary HTML injection vulnerability (also known as cross
site scripting, or XSS) due to the fact that it fails to user supplied
third party data before display.

Systems affected:
- -----------------
Drupal 6.22 with SuperCron 6.x-1.3 was tested and shown to be vulnerable

Impact
- ------
Attackers 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
permissions to access administration pages. This is an extremely
loose permission given the impact not only of this vulnerability but
also of the module's general functionality.

Proof of concept:
- -----------------
1. Install Drupal 6-22 and install and enable SuperCron 6.x-1.3
2. Navigate to SuperCron's Firewall settings at
?q=admin/settings/supercron/firewall
3. Enable the firewall
4. Expand the 'Insert IP' portion of the form
5. Insert "<script>alert('xss');</script>" for the IP address and
click the "Insert" button
6. Observe the transient JavaScript in the Drupal confirmation message
7. Persistent JavaScript is rendered at
?q=admin/settings/supercron/firewall

Patch:
- ------------------------------------------
Applying the following patch mitigates this issue in version 6.x-1.3
(and adds new permissions for the module)

- --- supercron/supercron.module 2009-06-15 02:55:20.000000000 -0400
+++ supercron.fixed/supercron.module 2011-10-30 00:34:24.316054217 -0400
@@ -23,7 +23,7 @@ function supercron_menu() {
'description' => t('Configure how Cron behaves, which cron hooks
are called and in what order, capture debugging information and
parallelize tasks.'),
'page callback' => 'drupal_get_form',
'page arguments' => array('supercron_settings'),
- - 'access arguments' => array('access administration pages'),
+ 'access arguments' => array('administer SuperCron'),
);
$items['admin/settings/supercron/'] = array(
'title' => t('Settings'),
@@ -34,20 +34,20 @@ function supercron_menu() {
'title' => t('Firewall'),
'page callback' => 'drupal_get_form',
'page arguments' => array('supercron_firewall_form'),
- - 'access arguments' => array('access administration pages'),
+ 'access arguments' => array('administer SuperCron'),
'type' => MENU_LOCAL_TASK,
'parent' => 'admin/settings/supercron'
);
$items['admin/settings/supercron/firewall/delete'] = array(
'page callback' => 'supercron_firewall_delete',
- - 'access arguments' => array('access administration pages'),
+ 'access arguments' => array('administer SuperCron'),
'type' => MENU_CALLBACK
);
$items['admin/settings/supercron/output/%'] = array(
'title' => t('Cron output in module: '),
'page callback' => 'supercron_output',
'page arguments' => array(4),
- - 'access arguments' => array('access administration pages'),
+ 'access arguments' => array('administer SuperCron'),
'type' => MENU_CALLBACK,
);

@@ -55,7 +55,7 @@ function supercron_menu() {
'title' => t('Cron exceptions in module: '),
'page callback' => 'supercron_exception',
'page arguments' => array(4),
- - 'access arguments' => array('access administration pages'),
+ 'access arguments' => array('administer SuperCron'),
'type' => MENU_CALLBACK,
);

@@ -63,20 +63,20 @@ function supercron_menu() {
'title' => t('Call individual cron handlers'),
'page callback' => 'supercron_invoke_one',
'page arguments' => array(4, 5),
- - 'access arguments' => array('access administration pages'),
+ 'access arguments' => array('administer SuperCron'),
'type' => MENU_CALLBACK,
);

$items[SUPERCRON_INVOKE_ALL] = array(
'page callback' => 'supercron_drupal_cron_run',
- - 'access arguments' => array('access administration pages'),
+ 'access arguments' => array('administer SuperCron'),
'type' => MENU_CALLBACK,
'file' => 'cron.inc',
);

$items['admin/reports/status/run-cron'] = array(
'page callback' => 'supercron_drupal_cron_run',
- - 'access arguments' => array('access administration pages'),
+ 'access arguments' => array('administer SuperCron'),
'type' => MENU_CALLBACK,
'file' => 'cron.inc',
);
@@ -137,6 +137,12 @@ function supercron_firewall_delete($id)
drupal_goto('admin/settings/supercron/firewall');
}

+function supercron_firewall_form_validate($form, &$form_state) {
+ if (! preg_match('/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/',
$form_state['values']['ip']) > 0) {
+ form_set_error('', t('Invalid IP address.'));
+ }
+}
+
function supercron_firewall_form(&$form_state) {
$firewall_enabled =
variable_get(SUPERCRON_FIREWALL_ENABLED_VARIABLE, FALSE);
$form['firewall_enable_field'] = array(
@@ -206,11 +212,11 @@ function supercron_firewall_form(&$form_
$result = db_query('SELECT * FROM {supercron_ips}');
while ($ip = db_fetch_object($result)) {
if ($firewall_enabled) {
- - $form[$ip->iid]['title'] = array('#value' => $ip->ip);
+ $form[$ip->iid]['title'] = array('#value' =>
check_plain($ip->ip));
$form[$ip->iid]['delete'] = array('#value' => l(t('delete'),
"admin/settings/supercron/firewall/delete/" . $ip->iid));
}
else {
- - $form[$ip->iid]['title'] = array('#value' => $ip->ip);
+ $form[$ip->iid]['title'] = array('#value' =>
check_plain($ip->ip));
$form[$ip->iid]['delete'] = array('#value' => '<span
style="text-decoration: line-through;">' . t('delete') . '</span>');
}
}
@@ -220,8 +226,10 @@ function supercron_firewall_form(&$form_
}

function supercron_firewall_add() {
- - db_query("INSERT INTO {supercron_ips} (ip) VALUES ('%s')",
$_POST['ip']);
- - drupal_set_message("IP $_POST[ip] added.");
+ if (preg_match('/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $_POST['ip'])
> 0) {
+ db_query("INSERT INTO {supercron_ips} (ip) VALUES ('%s')",
$_POST['ip']);
+ drupal_set_message("IP $_POST[ip] added.");
+ }
}

function supercron_firewall_enable() {
@@ -457,7 +465,7 @@ function supercron_module_add_output($mo
function supercron_output($id) {
$module = db_fetch_array(db_query_range("SELECT * FROM
{supercron_enabled_mods} WHERE id=%d", (int)$id, 0, 1));
drupal_set_title(drupal_get_title() . $module["module_name"]);
- - $output = $module["output"];
+ $output = filter_admin_xss($module["output"]);
return $output;
}


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

The digital signature on this e-mail may be confirmed using the
PGP key located at: http://www.madirish.net/gpgkey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iPwEAQECAAYFAk7zYxMACgkQkSlsbLsN1gCl9gb+NQ2vIjvmR/ggbduVmzC1QGJk
KZrtMbSpUStJvRj2pdZYRyfCCClQlSMR6nQwTa01+GNu7Hez7RTtSS8MwDENH5yW
QU+DSY/yMrj4GKBRGUnT2W7bONAOSVjSeYJDTEQ1g5ORzBZNQi2M4iLv5qc6siJo
nD+mQr8BbCqvAoxNwstmUIc+y9qrj9mXVKqyoPd1P9rC7EMbENWiqtp+29H4s4UF
80A/zMcKLJ1H9Xu1ZX2BVPH+9816ZBk4U2sMLHr2cgySh41Dx/ADM20+8hAvyA9N
V7gUil9RjhKbI0s6gmc=
=YKEw
-----END PGP SIGNATURE-----

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

June 2019

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close