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>
Sun, 24 Jul 2011 20:04:07 +0000 (22:04 +0200)
commit0e17d8ef7e4004a0d35011c322b93b6da5811951
treea62defc798d0453cbb80d878e5b0620e10e8e6b4
parent227921871146563c1d57f9a8faa3b8354058740c
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).
source3/web/cgi.c