summaryrefslogtreecommitdiffstats
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 20:39:25 +0200
commitd401ccaedaec09ad6900ec24ecaf205bed3e3ac1 (patch)
tree8152422cff9e3461e0c7684a654a2e2f8a27710b
parent5d2d4fbf5bcf6aa1c1d994adaed22dec3ba09b9c (diff)
downloadsamba-d401ccaedaec09ad6900ec24ecaf205bed3e3ac1.tar.gz
samba-d401ccaedaec09ad6900ec24ecaf205bed3e3ac1.tar.xz
samba-d401ccaedaec09ad6900ec24ecaf205bed3e3ac1.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> CVE-2011-2694.
-rw-r--r--source/web/swat.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/source/web/swat.c b/source/web/swat.c
index 9c7294a2a01..434b1ace4ec 100644
--- a/source/web/swat.c
+++ b/source/web/swat.c
@@ -1120,11 +1120,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."));
}
}
@@ -1138,14 +1136,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"));