s3 swat: Create random nonce in CGI mode
authorKai Blin <kai@samba.org>
Tue, 12 Jul 2011 06:08:24 +0000 (08:08 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 26 Jul 2011 18:48:20 +0000 (20:48 +0200)
commit57501dbfe425d53c0b20ce5a1c140e2d408cbc4c
tree5cedafc674e5d6c2c42910de1576d4119ff42377
parent31364595d493d2795dd6b0b5c162c8d911d35e21
s3 swat: Create random nonce in CGI mode

In CGI mode, we don't get access to the user's password, which would
reduce the hash used so far to parameters an attacker can easily guess.
To work around this, read the nonce from secrets.tdb or generate one if
it's not there.
Also populate the C_user field so we can use that for token creation.

Signed-off-by: Kai Blin <kai@samba.org>
The last 12 patches address bug #8290 (CSRF vulnerability in SWAT).
This addresses CVE-2011-2522 (Cross-Site Request Forgery in SWAT).
(cherry picked from commit a4922192d9b95e79bb31c54ca820a9b876a1bbe9)
source3/web/cgi.c