exploit the possibilities

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:

July 2019

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