Skip to content

Conversation

@RubenVerborgh
Copy link
Contributor

@RubenVerborgh RubenVerborgh commented Jul 25, 2017

Otherwise, when a user is logged in to their Solid server,
any third-party application could perform authenticated requests
without permission by including the credentials set by the Solid server.

Closes #524. Breaking change, needs new semver-major.

Note: this breaks Warp, which currently relies on cookie-based authentication (linkeddata/warp#23).

@RubenVerborgh
Copy link
Contributor Author

@dmitrizagidulin Updated check for equality with the hostnames of either the user ID or the server.

const userId = req.session.userId
console.log('check')
if (origin && userId) {
const userIdHost = userId.replace(/([^:/])\/.*/, '$1')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might grab the path, as well as the host? so, it'll be like ruben.databox.me/profile/card, yeah?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, n/m :) See it.

Otherwise, when a user is logged in to their Solid server,
any third-party application could perform authenticated requests
without permission by including the credentials set by the Solid server.

Closes #524. Breaking change, needs new semver-major.
@RubenVerborgh RubenVerborgh force-pushed the fix/no-cross-origin-cookie branch from 62a9044 to de38bf8 Compare July 25, 2017 21:09
@RubenVerborgh
Copy link
Contributor Author

@dmitrizagidulin Now with unit tests for the check.

@dmitrizagidulin
Copy link
Contributor

@RubenVerborgh 👍 , thank you!

@timbl
Copy link
Contributor

timbl commented Jun 15, 2018

There seems to be no discussion about the way this interacts with CORS. There is no isssue behind this PR?

@RubenVerborgh
Copy link
Contributor Author

@timbl The issue is tagged in the description, it's #524.

There's no interaction with CORS: we simply allow all cross-origin interactions on Solid servers, and also accept cookies with AJAX requests from any origin. As a result from that openness, we need to be careful about what requests we accept from what hosts, and the cookies mechanism wasn't doing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants