HTMLPurifier is a PHP library that helps to protect against XSS by filtering bad HTML and only allowing harmless markup. Recently a new version of HTMLPurifier has been released that fixes a hash length extension issue that I reported some time ago.
Hash length extension is a crypto attack against algorithms based on Merkle-Damgard construction (md5, sha1, etc) that allows to inject arbitrary characters into the signed data without knowing the secret key. A typical vulnerable piece of code looks like this:

if hash(secret + value) == signature:

With hash length extension we can append our data to the “value” and generate such a new signature that will satisfy the expression above. More information on this kind of attack can be found in this great article.

One of HTMLPurifier’s filters, namely URIFilter.Munge, can rewrite links to some custom address. It has also an ability to generate signatures that will protect these links from altering. However this is done in a way prone to hash length extension:

Web applications that rely on this signature to check the links, for example in URL redirectors or before placing them in the DB, may be vulnerable (for example Invision Power Board), because arbitrary data can be appended despite unknown secret.

Now HTMLPurifier uses secure HMAC-SHA256 to generate and verify signatures. Upgrade to 3.6.0 and be safe.

Radamsa is a cool tool that combines a set of fuzzers which generate data based on input string. You can feed it a PDF file for example and Radamsa will produce a bunch of PDF-alike documents that are fuzzed in all imaginable forms. Just see this:

Perfect for looking for all kinds of buffer overflows. And this tool can be especially useful combined with Burp Suite, that is why here is quick and dirty extension that enables you to use Radamsa to generate Burp Suite’s Intruder payloads:
Grab the code here: https://github.com/Raz0r/burp-radamsa

We have a simple form with login and password. There is an SQL injection, but a WAF blocks any attempt to bypass it. First step to solve this task was to reveal the contents of the script by requesting index.phps:

The first thing we see is that the password does not get into the SQL query, so we need to use at least UNION, but it is blocked. Guys from PPP tried time delaying heavy queries that do not rely on sleep() or becnhmark(), however the right way to solve this task is as follows. Firstly, one notices that passwords are compared using == operator, and secondly the GROUP operator is not filtered. In MySQL this operator can be used with some interesting modifier: WITH ROLLUP

The GROUP BY clause permits a WITH ROLLUP modifier that causes extra rows to be added to the summary output.

If you use column password on GROUP BY WITH ROLLUP, you will get an extra empty row. And as NULL and empty string if compared with operator == are equal it is possible to bypass the authorization using the following query:

Simple Machines Forum is a popular web community software written in PHP. Its password reset mechanism had some issues back in 2008. The vulnerability was caused by insecure random numbers generation and was patched right after the exploit was published. This time I found a more interesting vulnerability however at Positive Technologies we didn’t manage to raise awareness of SMF developers. After continuous silence of SMF devs I am disclosing the vulnerability details but I am not going to publish the exploit.