• Advisory ID: DRUPAL-SA-CONTRIB-2012-105
  • Project: Hashcash (third-party module)
  • Version: 6.x, 7.x
  • Date: 2012-June-27
  • Security risk: Moderately critical
  • Exploitable from: Remote
  • Vulnerability: Cross Site Scripting

Description

The Hashcash project is an implementation of a Proof Of Work (POW) or Puzzle scheme where users of a service have to do computational work to have their request granted. In the case of the Drupal Hashcash project, the service is 'form submission' and the Proof Of Work is a token that causes a partial hash collision when concatenated with a given string. This is intended to stop spam submissions to a site.

Cross Site Scripting

When an invalid token is received and the setting "Log failed hashcash" is enabled, the invalid token is written to watchdog with incorrect placeholders.

This enables an attacker to insert arbitrary scripts into certain pages displayed to administrators via the core module Database logging.

Mitigation: The setting "Log failed hashcash" is disabled by default.

Insufficient proof of work

The Hashcash project also fails as a proper proof of work scheme:

  • 1 in 256 random answers will be accepted as the correct answer.
  • The discrepancy in resources between a legitimate user using the Javascript hash implementation and an optimal attacker using a GPGPU implementation makes the cost of calculating a Hashcash token negligible for the attacker.

The protection against spambots offered by the Drupal Hashcash project hinges on the lack of interest on behalf of an attacker.

CVE: CVE-2012-4469

Versions affected

  • Hashcash 6.x-2.x versions prior to 6.x-2.6
  • Hashcash 7.x-2.x versions prior to 7.x-2.2

Drupal core is not affected. If you do not use the contributed Hashcash module, there is nothing you need to do.

Solution

To solve the cross site scripting issue, install the latest version:

There is no solution for the insufficient proof of work. You need to consider the consequences of this for your sites.

Also see the Hashcash project page.

Reported by

Fixed by

Contact and More Information

The Drupal security team can be reached at security at drupal.org or via the contact form at http://drupal.org/contact.

Learn more about the Drupal Security team and their policies, writing secure code for Drupal, and securing your site.