Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#2701 closed New feature (fixed)

Security: Enable iframe buster on all pages, except Widgets

Reported by: matt Owned by:
Priority: normal Milestone: 1.7 Piwik 1.7
Component: Core Keywords:
Cc: Sensitive: no

Description

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.

Change History (10)

comment:1 Changed 3 years ago by vipsoft (robocoder)

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.

comment:2 Changed 3 years ago by matt (mattab)

  • 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!

comment:3 Changed 2 years ago by matt (mattab)

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

comment:4 Changed 2 years ago by vipsoft (robocoder)

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?

comment:5 Changed 2 years ago by matt (mattab)

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).

comment:6 Changed 2 years ago by matt (mattab)

(In [5804]) Refs #2701
prevent click jacking attacks by dynamically adding the token auth when the link is clicked

comment:7 Changed 2 years ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

(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!

comment:8 Changed 2 years ago by matt (mattab)

  • Summary changed from Consider iframe buster to all pages, including widgets to Enable iframe buster on all pages, except Widgets

comment:9 Changed 2 years ago by vipsoft (robocoder)

Thanks for refactoring.

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

Otherwise looks OK.

comment:10 Changed 2 years ago by matt (mattab)

  • Summary changed from Enable iframe buster on all pages, except Widgets to Security: Enable iframe buster on all pages, except Widgets
  • Type changed from Bug to New feature
Note: See TracTickets for help on using tickets.