Drupal Association members fund grants that make connections all over the world.
- 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
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 protection against spambots offered by the Drupal Hashcash project hinges on the lack of interest on behalf of an attacker.
- 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.
To solve the cross site scripting issue, install the latest version:
- If you use the Hashcash module for Drupal 6.x, upgrade to Hashcash 6.x-2.6
- If you use the Hashcash module for Drupal 7.x, upgrade to Hashcash 7.x-2.2
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.
- Simon Rycroft, the module maintainer
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.