Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-Origin scripts can access data without restrictions #89

Open
retog opened this issue Jan 18, 2018 · 3 comments
Open

Cross-Origin scripts can access data without restrictions #89

retog opened this issue Jan 18, 2018 · 3 comments
Labels

Comments

@retog
Copy link

retog commented Jan 18, 2018

After login in on user.databox.me any page the user subsequently visits has full access to the user's data and can also add data to the user's LDPCs.

Steps to reproduce:

Expected results:

Actual results

@RubenVerborgh
Copy link
Member

I believe we need the equivalent of this Origin check: https://github.com/solid/solid-permissions/blob/v0.5.2/src/permission-set.js#L396

Note: We had a similar problem in node-solid-server (nodeSolidServer/node-solid-server#526), but the cause was different (it occurred with OIDC-based authentication).

@timbl
Copy link
Member

timbl commented Jun 15, 2018

Well, you get what you ask for.

accept-patch: application/json, application/sparql-update
accept-post: text/turtle, application/json
access-control-allow-credentials: true
access-control-allow-origin: https://retog.github.io
access-control-expose-headers: User, Location, Link, Vary, Last-Modified, WWW-Authenticate, Content-Length, Content-Type, Accept-Patch, Accept-Post, Allow, Updates-Via, Ms-Author-Via
access-control-max-age: 1728000
allow: OPTIONS, HEAD, GET, PATCH, POST, PUT, MKCOL, DELETE, COPY, MOVE, LOCK, UNLOCK
content-length: 0
content-type: text/plain; charset=utf-8
date: Fri, 15 Jun 2018 13:39:25 GMT
link: <https://beta.databox.me/evil-5099ea,meta>; rel="meta", <https://beta.databox.me/evil-5099ea,acl>; rel="acl", <http://www.w3.org/ns/ldp#Resource>; rel="type"
location: https://beta.databox.me/evil-5099ea
ms-author-via: DAV, SPARQL
status: 201
updates-via: wss://beta.databox.me/
user: https://beta.databox.me/profile/card#me
vary: Origin

These headers from the server say that the client origin is explicitly trusted. We can't get upset about cross-origin access when the browser goes to huge lengths to block it, and we have gone to even huger lengths to open it up again.

Protection against this attack is built into the browser.
We disable it by explicitly telling the browser that for any origin which access it, that origin is trusted. You get what you ask for.

Browser security is based on the Same Origin Model... if we want to tweak that we do it carefully but maybe not reinvent it. we have origin reflector code in the server specifically to give all origins ability to access data. We turned that on, to fix this we turn it off (work break warp etc) or make it speific to origins we trust.

@RubenVerborgh
Copy link
Member

I think the reasoning is that: yes, we open up cross-origin requests, but we shield it off with another mechanism. I.e., when a user is not allowed to perform an operation, we want to be able to reply with 401/403, not with “cross-origin request blocked”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants