I'm looking at lines 145,146 of csrf.py
good_referer = 'https://%s/' % request.get_host()
if not same_origin(referer, good_referer):
And from the link I posted, the value for HTTP_X_FORWARDED_HOST overrides the real host. So instead of spoofing your referer to match the host, trick the host into thinking it's the referer:
POST / HTTP/1.1
host: good.com
referer: evil.com
X_FORWARDED_HOST: evil.com
edit: or does this screw up the part of the script that finds which vhost to load?
Edited 2 time(s). Last edit at 04/12/2011 12:22PM by barbarianbob.