The javascript settings get included into the page without any filtering. This allows someone with permission to configure the module to inject malicious code, i.e. a cross-site-scripting attack.

I can think of 3 possible solutions:
1. filter the admin-added values to ensure they don't include malicious code
2. change the hook_permission to make 'restrict access' => TRUE for the administration permission
3. both?

I think solution #1 is the best.

This issue can be in the public queue instead of a private security.drupal.org issue because the Quantcast module doesn't have a stable release (see the policy https://www.drupal.org/security-advisory-policy on which releases get advisories).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

coltrane’s picture

Status: Active » Needs review
FileSize
622 bytes

Entering this as the "Quantcast P-Code" will demonstrate the XSS issue:

"});</script><script>alert('foo')</script><!--

Patch uses check_plain() to mitigate.

DamienMcKenna’s picture

FileSize
575 bytes

The code has changed a good bit, so here's a reroll.

DamienMcKenna’s picture

BTW the patch also removes a redundant variable_get() from quantcast_page_build().

greggles’s picture

Any feedback from the maintainers about this issue?

  • greggles committed 05b7be5 on 7.x-2.x authored by coltrane
    Issue #2462487 by DamienMcKenna, coltrane: XSS Via Settings
    
greggles’s picture

Status: Needs review » Fixed

Now fixed. Thanks for the reroll, DamienMcKenna!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.