Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Security: Enable iframe buster on all pages, except Widgets #2701

Closed
mattab opened this Issue · 8 comments

2 participants

Matthieu Aubry Anthon Pang
Matthieu Aubry
Owner
  • Consider extending click jacking http://dev.piwik.org/trac/changeset/4451#file0 and http://piwik.org/faq/how-to/#faq_92 to all pages, including: Email reports, API page.
  • Also, can we remove token_auth from all rendered piwik pages? When report is iframed, and the token_auth is NOT specified, it would be nice if the token_auth was NOT displayed at all in no page. This would prevent clickjack even further.
Anthon Pang
Collaborator

If we add new settings, e.g.,

  • enable_framed_dashboard
  • enable_framed_widgets

I would recommend secure-by-default. So, the big compatbuster is that the Widgets page would display a warning div if enable_framed_widgets=0.

Matthieu Aubry
Owner
  • when token_auth is NOT specified, the HTML generated in the Iframe will not contain token_auth. So, it is OK that it is not secure.
  • when token_auth is specicied, the dragndrop vector is due to token_auth found in hard links. AFAIK We can mitigate this issue by removing the token_auth from all links. Then the widgets will be "secure" unless there is some other risk involved I'm missing!
Matthieu Aubry
Owner

I got confirmation that removing token_auth from all HREF will solve the sec issue.

Also, Anthon we could make secure by default all pages that are NOT widgets (in particular the API age and Email reports page which contain the token). For these, secure by default makes sense (since iframing them is not desired).

Plan would be :

  • allow iframing all widgets and dashboard
  • remove token_auth from all HREF links to prevent drag n drop (token_auth would be added "on click" in javascript?)
  • secure by default (via Xframe deny header) all pages that are NOT (widgets or dashboard)

PS: contact mauro when fixed

Anthon Pang
Collaborator

What about this? If any existing sites have anonymous view access, then the updater writes the override setting to config.ini.php. In this case, could we default to no framing anywhere?

Matthieu Aubry
Owner

but if we don't allow framing of widgets and dashboard, we remove a big feature from Piwik (which would require config file edit to support). It seems in this case that we can keep the feature and make it 100% safe by not having the token_auth in any of the <A> links (which allows for drag n drop attacks).

Matthieu Aubry
Owner

(In [5804]) Refs #2701

prevent click jacking attacks by dynamically adding the token auth when the link is clicked

Matthieu Aubry
Owner

(In [5805]) Fixes #2701

  • Iframe busting ALL pages except widgets/dashboard
  • Refactored iframe busting code
  • This new behavior might break some backward compatibility but can be disabled by setting enable_framed_pages = 1 in the config file

@vipsoft your review is welcome on this one!

Anthon Pang
Collaborator

Thanks for refactoring.

May want to add a comment to global.ini.php that enable_framed_logins overrides this new setting.

Otherwise looks OK.

Matthieu Aubry mattab added this to the 1.7 Piwik 1.7 milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.