summaryrefslogtreecommitdiffstats
path: root/source3/web/swat.c
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2011-07-07 10:03:33 +0200
committerKarolin Seeger <kseeger@samba.org>2011-07-24 21:25:46 +0200
commit05fa09be5a801baa5d35014e2f54b46c1ff5466b (patch)
treecd044abce1c5f2967cfb2543b3c3e94822245170 /source3/web/swat.c
parent315437d3d5a503b2d17c8a01f0e2c088febb041a (diff)
downloadsamba-05fa09be5a801baa5d35014e2f54b46c1ff5466b.tar.gz
samba-05fa09be5a801baa5d35014e2f54b46c1ff5466b.tar.xz
samba-05fa09be5a801baa5d35014e2f54b46c1ff5466b.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/web/swat.c')
-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 4bfb7318148..ac5787bf1fc 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -1121,11 +1121,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."));
}
}
@@ -1139,14 +1137,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"));