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 19:28:16 +0000 (21:28 +0200)
commita4922192d9b95e79bb31c54ca820a9b876a1bbe9
treeca68d5aef2cd48a600268455ba6bc31f094e1e96
parent0b811f5b825637b2ecb0450d24dc6b3425ad05a8
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