XBackBone icon indicating copy to clipboard operation
XBackBone copied to clipboard

Prevent clickjacking attack

Open SenkaWolf opened this issue 11 months ago • 2 comments

.htaccess updated to prevent iframes working with XBackBone installations.

Issue raised on https://github.com/sergix44/XBackBone/issues/432

SenkaWolf avatar Jan 19 '25 15:01 SenkaWolf

I remember doing some research, but some people use XBB as a cdn, so there are cases where iframes are actually a wanted feature. Also, this would only "fix" installations behind apache, not nginx or other web servers, and requires mod_headers to be enabled, otherwise a 500 is raised. Since this problem is not really application dependent, but rather deployment/use-case/webserver dependent, I don't feel comfortable merging this. It's possible having a middleware that set that header behind a feature flag maybe 🤔

sergix44 avatar Jan 23 '25 10:01 sergix44

Could potentially do what VaultWarden currently does for Iframes to fix this issue and that is an configurable option to choose allowed iframe ancestors and allowed connect-src. Maybe there could also be an option to define which domains can use iframes

More info (explanation from VaultWarden): [allowed_iframe_ancestors] Allows other domains to embed the web vault into an iframe, useful for embedding into secure intranets. [allowed_connect_src] Allows other domains to URLs which can be loaded using script interfaces like the Forwarded email alias feature

This would fix the clickjacking attack while still allowing XBackBone admins to use iframes if they so which.

SrS2225a avatar Jan 25 '25 00:01 SrS2225a