controlled access to your WUI #674

Open
opened 2009-04-03 15:56:16 +00:00 by zooko · 8 comments

Currently the Welcome Page of the WUI is reachable without knowing any secret, for example, this one: http://testgrid.allmydata.org:3567 . (If you configure your WUI to listen for connections only from localhost then that prevents people from connecting to it from other hosts, but it doesn't prevent CSRF attacks in which someone posts a web page to Tahoe, and when you view that page with JavaScript enabled, or click on a button on that page, then it accesses your WUI.)

It would be good to have a page which is access-controlled by use of a secret capability even though it isn't specific to a file or directory. The entire Welcome Page might belong no that Access Controlled Welcome Page, or maybe only the sensitive pieces would go onto the Access Controlled Welcome Page.

As an example (this might or might not be a good idea), the Access Controlled Welcome Page could have a log of the caps of all of your recent uploads/downloads.

Currently the Welcome Page of the WUI is reachable without knowing any secret, for example, this one: <http://testgrid.allmydata.org:3567> . (If you configure your WUI to listen for connections only from localhost then that prevents people from connecting to it from other hosts, but it doesn't prevent CSRF attacks in which someone posts a web page to Tahoe, and when you view that page with JavaScript enabled, or click on a button on that page, then it accesses your WUI.) It would be good to have a page which is access-controlled by use of a secret capability even though it isn't specific to a file or directory. The entire Welcome Page might belong no that Access Controlled Welcome Page, or maybe only the sensitive pieces would go onto the Access Controlled Welcome Page. As an example (this might or might not be a good idea), the Access Controlled Welcome Page could have a log of the caps of all of your recent uploads/downloads.
zooko added the
unknown
major
enhancement
1.3.0
labels 2009-04-03 15:56:16 +00:00
zooko added this to the undecided milestone 2009-04-03 15:56:16 +00:00

A nitpick on which threat scenario this prevents:

This prevents CSRF attacks which maliciously embed an easily guessable action-causing request into a context for the victim to consume.

Whether or not Javascript is used is irrelevant. In particular, preventing CSRF attacks will not protect against malicious Javascript which has the wapi as its origin.

It would protect against CSRF attacks launched via Javascript, as well as any other CSRF attacks from a different origin.

Additionally, the implementation should consider non-Javascript CSRF attacks from the same origin. For example a request format of "http://$HOST:$PORT/$WUI_SECRET/uri/$FILE_READ_CAP" would not protect against relative urls from the $HOST:$PORT origin (such as a malicious html page within a Tahoe grid).

For this reason, it seems like file/directory retrieval URLs should not contain the $WUI_SECRET in their URL. Their own cap already provides protection against forgery, and this prevents the relative path, same origin, CSRF.

A nitpick on which threat scenario this prevents: This prevents CSRF attacks which maliciously embed an easily guessable action-causing request into a context for the victim to consume. Whether or not Javascript is used is irrelevant. In particular, preventing CSRF attacks will not protect against malicious Javascript which has the wapi as its origin. It *would* protect against CSRF attacks launched via Javascript, as well as any other CSRF attacks from a _different_ origin. Additionally, the implementation should consider non-Javascript CSRF attacks from *the same origin*. For example a request format of "<http://$HOST:$PORT/$WUI_SECRET/uri/$FILE_READ_CAP>" would *not* protect against relative urls from the $HOST:$PORT origin (such as a malicious html page within a Tahoe grid). For this reason, it seems like file/directory retrieval URLs should not contain the $WUI_SECRET in their URL. Their own cap already provides protection against forgery, and this prevents the relative path, same origin, CSRF.

I should have provided more details for my last post.

Javascript from the same origin should be able to grab the $WUI_SECRET from its location (and may be able to grab it from another window even in the scheme where the $WUI_SECRET is not present in retrieval URLs).

A same-origin CSRF that exploits the "http://$host/$WUI_SECRET/uri/$FILE_READ_CAP" url might be html containing .

I should have provided more details for my last post. Javascript from the same origin should be able to grab the $WUI_SECRET from its location (and may be able to grab it from another window even in the scheme where the $WUI_SECRET is not present in retrieval URLs). A same-origin CSRF that exploits the "<http://$host/$WUI_SECRET/uri/$FILE_READ_CAP>" url might be html containing <img src="<http://../../admin?delete_all_shared=true>">.

good point. I suppose that means making the $WUI_SECRET pages come from a completely different origin, by using a separate port number or something. We'd still need $WUI_SECRET, of course.

We'll have to have a rule that says we never emit unescaped external content on any page served below $WUI_SECRET . That means not using this namespace for delivering files or directories, and it also means being careful about escaping node nicknames and log messages and anything else that we might want to serve from that space.

good point. I suppose that means making the $WUI_SECRET pages come from a completely different origin, by using a separate port number or something. We'd still need $WUI_SECRET, of course. We'll have to have a rule that says we never emit unescaped external content on any page served below $WUI_SECRET . That means not using this namespace for delivering files or directories, and it also means being careful about escaping node nicknames and log messages and anything else that we might want to serve from that space.
warner added
code-frontend-web
and removed
unknown
labels 2009-07-11 11:23:28 +00:00
Author

#1911 was a new related ticket

#1911 was a new related ticket
tahoe-lafs modified the milestone from undecided to 1.12.0 2015-04-12 21:44:28 +00:00

Milestone renamed

Milestone renamed
warner modified the milestone from 1.12.0 to 1.13.0 2016-03-22 05:02:25 +00:00

renaming milestone

renaming milestone
warner modified the milestone from 1.13.0 to 1.14.0 2016-06-28 18:17:14 +00:00

Moving open issues out of closed milestones.

Moving open issues out of closed milestones.
exarkun modified the milestone from 1.14.0 to 1.15.0 2020-06-30 14:45:13 +00:00
Owner

Ticket retargeted after milestone closed

Ticket retargeted after milestone closed
meejah modified the milestone from 1.15.0 to soon 2021-03-30 18:40:19 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#674
No description provided.