[Pkg-samba-maint] r4190 - in branches/samba/wheezy/debian: . patches

bubulle at alioth.debian.org bubulle at alioth.debian.org
Thu Jan 31 19:53:43 UTC 2013


Author: bubulle
Date: 2013-01-31 19:53:43 +0000 (Thu, 31 Jan 2013)
New Revision: 4190

Added:
   branches/samba/wheezy/debian/patches/security-CVE-2013-0213.patch
   branches/samba/wheezy/debian/patches/security-CVE-2013-0214.patch
Modified:
   branches/samba/wheezy/debian/changelog
   branches/samba/wheezy/debian/patches/series
Log:
* Security update
* CVE-2013-0213: Clickjacking issue in SWAT
* CVE-2013-0214: Potential XSRF in SWAT

Modified: branches/samba/wheezy/debian/changelog
===================================================================
--- branches/samba/wheezy/debian/changelog	2013-01-31 09:41:32 UTC (rev 4189)
+++ branches/samba/wheezy/debian/changelog	2013-01-31 19:53:43 UTC (rev 4190)
@@ -1,3 +1,11 @@
+samba (2:3.6.6-5) unstable; urgency=high
+
+  * Security update
+  * CVE-2013-0213: Clickjacking issue in SWAT
+  * CVE-2013-0214: Potential XSRF in SWAT
+
+ -- Christian Perrier <bubulle at debian.org>  Wed, 30 Jan 2013 18:49:32 +0100
+
 samba (2:3.6.6-4) unstable; urgency=low
 
   * Fix printers tdb migration by including an upstream fix

Added: branches/samba/wheezy/debian/patches/security-CVE-2013-0213.patch
===================================================================
--- branches/samba/wheezy/debian/patches/security-CVE-2013-0213.patch	                        (rev 0)
+++ branches/samba/wheezy/debian/patches/security-CVE-2013-0213.patch	2013-01-31 19:53:43 UTC (rev 4190)
@@ -0,0 +1,34 @@
+From 72672f8074c0a65918756ad89a8ecc2befc72cf0 Mon Sep 17 00:00:00 2001
+From: Kai Blin <kai at samba.org>
+Date: Fri, 18 Jan 2013 23:11:07 +0100
+Subject: [PATCH] swat: Use X-Frame-Options header to avoid clickjacking
+
+Jann Horn reported a potential clickjacking vulnerability in SWAT where
+the SWAT page could be embedded into an attacker's page using a frame or
+iframe and then used to trick the user to change Samba settings.
+
+Avoid this by telling the browser to refuse the frame embedding via the
+X-Frame-Options: DENY header.
+
+Signed-off-by: Kai Blin <kai at samba.org>
+---
+ source3/web/swat.c |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/source3/web/swat.c b/source3/web/swat.c
+index 90e4af9..1eb191d 100644
+--- a/source3/web/swat.c
++++ b/source3/web/swat.c
+@@ -269,7 +269,8 @@ static void print_header(void)
+ 	if (!cgi_waspost()) {
+ 		printf("Expires: 0\r\n");
+ 	}
+-	printf("Content-type: text/html\r\n\r\n");
++	printf("Content-type: text/html\r\n");
++	printf("X-Frame-Options: DENY\r\n\r\n");
+ 
+ 	if (!include_html("include/header.html")) {
+ 		printf("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n");
+-- 
+1.7.0.4
+

Added: branches/samba/wheezy/debian/patches/security-CVE-2013-0214.patch
===================================================================
--- branches/samba/wheezy/debian/patches/security-CVE-2013-0214.patch	                        (rev 0)
+++ branches/samba/wheezy/debian/patches/security-CVE-2013-0214.patch	2013-01-31 19:53:43 UTC (rev 4190)
@@ -0,0 +1,116 @@
+From f102cb2316b9590c91a248ccd77f335d0cd99764 Mon Sep 17 00:00:00 2001
+From: Kai Blin <kai at samba.org>
+Date: Mon, 28 Jan 2013 21:41:07 +0100
+Subject: [PATCH] swat: Use additional nonce on XSRF protection
+
+If the user had a weak password on the root account of a machine running
+SWAT, there still was a chance of being targetted by an XSRF on a
+malicious web site targetting the SWAT setup.
+
+Use a random nonce stored in secrets.tdb to close this possible attack
+window. Thanks to Jann Horn for reporting this issue.
+
+Signed-off-by: Kai Blin <kai at samba.org>
+---
+ source3/web/cgi.c        |   40 ++++++++++++++++++++++++++--------------
+ source3/web/swat.c       |    2 ++
+ source3/web/swat_proto.h |    1 +
+ 3 files changed, 29 insertions(+), 14 deletions(-)
+
+Index: wheezy/source3/web/cgi.c
+===================================================================
+--- wheezy.orig/source3/web/cgi.c
++++ wheezy/source3/web/cgi.c
+@@ -48,6 +48,7 @@
+ static char *pathinfo;
+ static char *C_user;
+ static char *C_pass;
++static char *C_nonce;
+ static bool inetd_server;
+ static bool got_request;
+ 
+@@ -329,20 +330,7 @@
+ 	C_user = SMB_STRDUP(user);
+ 
+ 	if (!setuid(0)) {
+-		C_pass = secrets_fetch_generic("root", "SWAT");
+-		if (C_pass == NULL) {
+-			char *tmp_pass = NULL;
+-			tmp_pass = generate_random_password(talloc_tos(),
+-							    16, 16);
+-			if (tmp_pass == NULL) {
+-				printf("%sFailed to create random nonce for "
+-				       "SWAT session\n<br>%s\n", head, tail);
+-				exit(0);
+-			}
+-			secrets_store_generic("root", "SWAT", tmp_pass);
+-			C_pass = SMB_STRDUP(tmp_pass);
+-			TALLOC_FREE(tmp_pass);
+-		}
++		C_pass = SMB_STRDUP(cgi_nonce());
+ 	}
+ 	setuid(pwd->pw_uid);
+ 	if (geteuid() != pwd->pw_uid || getuid() != pwd->pw_uid) {
+@@ -459,6 +447,30 @@
+ }
+ 
+ /***************************************************************************
++return a ptr to the nonce
++  ***************************************************************************/
++char *cgi_nonce(void)
++{
++	const char *head = "Content-Type: text/html\r\n\r\n<HTML><BODY><H1>SWAT installation Error</H1>\n";
++	const char *tail = "</BODY></HTML>\r\n";
++	C_nonce = secrets_fetch_generic("root", "SWAT");
++	if (C_nonce == NULL) {
++		char *tmp_pass = NULL;
++		tmp_pass = generate_random_password(talloc_tos(),
++						    16, 16);
++		if (tmp_pass == NULL) {
++			printf("%sFailed to create random nonce for "
++			       "SWAT session\n<br>%s\n", head, tail);
++			exit(0);
++		}
++		secrets_store_generic("root", "SWAT", tmp_pass);
++		C_nonce = SMB_STRDUP(tmp_pass);
++		TALLOC_FREE(tmp_pass);
++	}
++        return(C_nonce);
++}
++
++/***************************************************************************
+ handle a file download
+   ***************************************************************************/
+ static void cgi_download(char *file)
+Index: wheezy/source3/web/swat.c
+===================================================================
+--- wheezy.orig/source3/web/swat.c
++++ wheezy/source3/web/swat.c
+@@ -154,6 +154,7 @@
+ 	struct MD5Context md5_ctx;
+ 	uint8_t token[16];
+ 	int i;
++	char *nonce = cgi_nonce();
+ 
+ 	token_str[0] = '\0';
+ 	ZERO_STRUCT(md5_ctx);
+@@ -167,6 +168,7 @@
+ 	if (pass != NULL) {
+ 		MD5Update(&md5_ctx, (uint8_t *)pass, strlen(pass));
+ 	}
++	MD5Update(&md5_ctx, (uint8_t *)nonce, strlen(nonce));
+ 
+ 	MD5Final(token, &md5_ctx);
+ 
+Index: wheezy/source3/web/swat_proto.h
+===================================================================
+--- wheezy.orig/source3/web/swat_proto.h
++++ wheezy/source3/web/swat_proto.h
+@@ -32,6 +32,7 @@
+ bool am_root(void);
+ char *cgi_user_name(void);
+ char *cgi_user_pass(void);
++char *cgi_nonce(void);
+ void cgi_setup(const char *rootdir, int auth_required);
+ const char *cgi_baseurl(void);
+ const char *cgi_pathinfo(void);

Modified: branches/samba/wheezy/debian/patches/series
===================================================================
--- branches/samba/wheezy/debian/patches/series	2013-01-31 09:41:32 UTC (rev 4189)
+++ branches/samba/wheezy/debian/patches/series	2013-01-31 19:53:43 UTC (rev 4190)
@@ -22,3 +22,5 @@
 shadow_copy2_backport.patch
 only_export_public_symbols.patch
 0001-ndr-fix-push-pull-DATA_BLOB-with-NDR_NOALIGN.patch
+security-CVE-2013-0213.patch
+security-CVE-2013-0214.patch





More information about the Pkg-samba-maint mailing list