summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2011-07-07 10:03:33 +0200
committerJeremy Allison <jra@samba.org>2011-07-26 22:22:25 +0200
commitdc50cf38c11ad845115bae35d2dc8a7e9c4893ff (patch)
tree221a602705636bd3fe3e8d224e592b4aefe96946 /source3
parent78b54e9ee1d9fa7d3117a0a82db11da3f9ec8223 (diff)
downloadsamba-dc50cf38c11ad845115bae35d2dc8a7e9c4893ff.tar.gz
samba-dc50cf38c11ad845115bae35d2dc8a7e9c4893ff.tar.bz2
samba-dc50cf38c11ad845115bae35d2dc8a7e9c4893ff.zip
s3 swat: Fix possible XSS attack (bug #8289)
Nobuhiro Tsuji of NTT DATA SECURITY CORPORATION reported a possible XSS attack against SWAT, the Samba Web Administration Tool. The attack uses reflection to insert arbitrary content into the "change password" page. This patch fixes the reflection issue by not printing user-specified content on the website anymore. Signed-off-by: Kai Blin <kai@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/web/swat.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/source3/web/swat.c b/source3/web/swat.c
index 15632b763a..e82558b343 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -1133,11 +1133,9 @@ static void chg_passwd(void)
if(cgi_variable(CHG_S_PASSWD_FLAG)) {
printf("<p>");
if (rslt == True) {
- printf(_(" The passwd for '%s' has been changed."), cgi_variable_nonull(SWAT_USER));
- printf("\n");
+ printf("%s\n", _(" The passwd has been changed."));
} else {
- printf(_(" The passwd for '%s' has NOT been changed."), cgi_variable_nonull(SWAT_USER));
- printf("\n");
+ printf("%s\n", _(" The passwd for has NOT been changed."));
}
}
@@ -1151,14 +1149,6 @@ static void passwd_page(void)
{
const char *new_name = cgi_user_name();
- /*
- * After the first time through here be nice. If the user
- * changed the User box text to another users name, remember it.
- */
- if (cgi_variable(SWAT_USER)) {
- new_name = cgi_variable_nonull(SWAT_USER);
- }
-
if (!new_name) new_name = "";
printf("<H2>%s</H2>\n", _("Server Password Management"));