Skip to content

Commit

Permalink
[WebUI] Avoid clickjacking attacks
Browse files Browse the repository at this point in the history
  • Loading branch information
ngosang authored and sledgehammer999 committed Mar 3, 2017
1 parent f9c39e3 commit f5ad047
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/base/http/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ namespace Http
const QString HEADER_CONTENT_ENCODING = "Content-Encoding";
const QString HEADER_CONTENT_LENGTH = "Content-Length";
const QString HEADER_CACHE_CONTROL = "Cache-Control";
const QString HEADER_X_FRAME_OPTIONS = "X-Frame-Options";

const QString CONTENT_TYPE_CSS = "text/css; charset=UTF-8";
const QString CONTENT_TYPE_GIF = "image/gif";
Expand Down
6 changes: 5 additions & 1 deletion src/webui/abstractwebapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ Http::Response AbstractWebApplication::processRequest(const Http::Request &reque
request_ = request;
env_ = env;

clear(); // clear response
// clear response
clear();

// avoid clickjacking attacks
header(Http::HEADER_X_FRAME_OPTIONS, "SAMEORIGIN");

sessionInitialize();
if (!sessionActive() && !isAuthNeeded())
Expand Down

2 comments on commit f5ad047

@carnil
Copy link

@carnil carnil commented on f5ad047 Mar 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is CVE-2017-6504

@psitem
Copy link

@psitem psitem commented on f5ad047 Mar 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigh. I've been iframing the web UI for years and now it's broken.

Please sign in to comment.