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

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
SHA-256 | 8a89f2d6aafb86f8a2a868799cba22ec0847d46793c38a7e65f20270b976c80e

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-----

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
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 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