From 4c5f175064bcbb8c404cba90f9f08f623275c6de Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Fri, 8 Jul 2011 15:02:53 +0200 Subject: s3 swat: Add XSRF protection to viewconfig page Signed-off-by: Kai Blin (cherry picked from commit b25d00e3c1ff91e7ec5f56ec2ad0d6b3d635d1e3) --- source3/web/swat.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/web/swat.c b/source3/web/swat.c index 95837b4ea5e..c0917db171c 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -665,13 +665,20 @@ static void welcome_page(void) static void viewconfig_page(void) { int full_view=0; + const char form_name[] = "viewconfig"; + + if (!verify_xsrf_token(form_name)) { + goto output_page; + } if (cgi_variable("full_view")) { full_view = 1; } +output_page: printf("

%s

\n", _("Current Config")); printf("
\n"); + print_xsrf_token(cgi_user_name(), cgi_user_pass(), form_name); if (full_view) { printf("\n", _("Normal View")); -- cgit v1.2.1