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>
Wed, 27 Jul 2011 17:40:23 +0000 (19:40 +0200)
commit6b7a7d865bdb8e61537ba4795e24facee2df240e
tree80b20d18b8902bc526af397b9ab14924e5a29326
parente16316d08e2b0e3d857fd6d72abdde2c19eaf5c9
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 3973cfa50024983618a44ffdb9f756b642b85be7)
source/web/cgi.c
source/web/swat.c