WUI: ambiently accessible pages should framebust in order to prevent UI redressing attacks #1455
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#1455
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If an ambiently accessible WUI page (one that does not require a capability to access, such as the Welcome page) is loaded in a frame or iframe, the loading frame might be able to perform some UI redressing or clickjacking attacks.
For example, the loading frame could entice the user to click the "Create a directory" button, when it should not have the authority to create a directory on that grid.
This is not a very strong attack. In any case, it can be prevented by including some framebusting code on ambiently accessible WUI pages (or all WUI pages).
How not to framebust: http://seclab.stanford.edu/websec/framebusting/framebust.pdf
The way to do it securely seems to be to send an X-Frame-Options: DENY header.
According to https://developer.mozilla.org/en-US/docs/The_X-FRAME-OPTIONS_response_header , X-Frame-Options is supported by:
I think there might be some benefit in including the header for all WUI pages, not just ambiently accessible ones. In conjunction with #1797, that would simplify reasoning about some of the attacks we were worried about in the 2012-08-28 conference call.
I am trying to take this, but I have serious problems finding the appropriate code to patch.
It looks like a lot of HTTP handling is scattered through all files in src/web/, which makes it particularly hard to add a security header for all HTTP responses :(
It is unclear to me what the childFactory methods in web/root.py do and the nevow guides weren't very helpful.
If they are called for each incoming request, I would consider writing a function that takes a context (
ctx
) and sets the desired headers for the corresponding request (IRequest(ctx)
it seems).Otherwise I would have to patch the request handlers for every HTTP method (i.e.
render_FOO
). A pointer for this would also be helpful.If it's not explicitly undesired, I am considering adding other security headers in a follow-up and might therefore do some changes that are not exactly required for the X-Frame-Options patch.
Oh, and on a side-note: I would suggest to set the X-Frame-Options header to
SAMEORIGIN
and notDENY
. This way, HTML files hosted on tahoe can be framed by other files in the grid. I assume that some users might require this. If there is consensus to takeDENY
, I will happily obey ;-)OK, it seems easy enough to do this for uri/ and file/ resources by patching FileHandler and URIHandler classes in root.py. See this commit on my feature branch
I have yet to figure out how to do this for things like /statistics, /status, etc. It seems undesirable to re-implement this for every subpage in its own file in src/web/. This would mean that every new subresource would have to remember doing this again to ensure that no URL is left behind ;)
Wouldn't it make sense to build a tiny abstraction layer on top of nevow's
rend.Page
that ensures proper response headers and is to be used in all files? This would still require changes in all files, but these could be less careful, as we just replacerend.Page
references.Ha, I think I solved it differently. Please see https://github.com/tahoe-lafs/tahoe-lafs/pull/72 or https://github.com/freddyb/tahoe-lafs/commits/ticket1455-x-frame-options
I think warner did the most WUI things, so review appreciated
Reviewing.
I seem to have lost track of this after saying I'd review it. I'll rebase it soon.
Rebased to https://github.com/tahoe-lafs/tahoe-lafs/commits/1455.x-frame-options.1. (I changed SAMEORIGIN to DENY.)
Needs a test.
BTW, it needs to be DENY rather than SAMEORIGIN because the attacking page might also be on the grid.
Milestone renamed
moving most tickets from 1.12 to 1.13 so we can release 1.12 with magic-folders
In 718fa44/trunk:
Fixed in bfedd796338398b3d8ab21520d48cddca42c425d