Skip to content

Block cookie auth from non-subdomains, but allow all other auth from everywhere #835

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

Merged
merged 3 commits into from
Oct 2, 2018

Conversation

RubenVerborgh
Copy link
Contributor

#834 overreached, since it applied the cross-domain cookie ban from #793 to all auth methods, not just the cookie-base auth method.

The implementation currently contains a level-breaking hack, where the general module needs to know about the OIDC logout paths. A proper fix would require a more intense refactoring, where cookie-based auth is seen as a third method in addition to WebID-TLS and WebID-OIDC, not as part of either.

Also, we should note that this fix (as did #834) allows any third party app to log the user out without their explicit permission if they happen to know the user's pod.

@kidehen
Copy link

kidehen commented Oct 2, 2018

@RubenVerborgh ,

Re

Also, we should note that this fix (as did #834) allows any third party app to log the user out without their explicit permission if they happen to know the user's pod.

I assume that only applies to WebID-OIDC mode servers rather than both WebID-OIDC or WebID-TLS mode servers. Basically, if one deployed a TLS-mode pod said issue wouldn't exist, which is what I would expect.

@RubenVerborgh
Copy link
Contributor Author

I assume that only applies to WebID-OIDC rather than both WebID-OIDC and WebID-TLS.

Yes.

@RubenVerborgh
Copy link
Contributor Author

Actually, @kidehen, I realize that this issue is not a server-side issue but an OIDC client issue.

At the moment, the logout request is being authenticated through a cookie. And we normally block cross-origin cookies for security purposes, but now explicitly make an exception for logout requests.

However, why don't we authenticate the logout request with an OIDC bearer token? Then none of this is necessary. Or is this against OIDC spec?

function isLogoutRequest (req) {
// TODO: this is a hack that hard-codes OIDC paths,
// this code should live in the OIDC module
return req.path === '/logout' || req.path === '/goodbye'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kidehen I copied this code from @smalinin, but I actually don't think that goodbye is necessary in this exception list (although it doesn't really hurt). The user needs to be authenticated for logout, but not for goodbye, right?

Copy link

Choose a reason for hiding this comment

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

Hmm..
I would suggest the workaround as is for now, we know it works (and it doesn't hurt in the worst case).

/cc @smalinin @cblakeley

@dmitrizagidulin
Copy link
Contributor

dmitrizagidulin commented Oct 2, 2018

Authenticating with a cookie is a temporary hack. The spec requires the token to be used. This is implemented in oidc-op, btw.

(apologies for brevity, on mobile)

@RubenVerborgh
Copy link
Contributor Author

Thanks @dmitrizagidulin, this is what I suspected. Anything stopping solid-auth-client from using that oidc-op code? We use logout on oidc-rp right now.

@dmitrizagidulin
Copy link
Contributor

Yeah, solid-auth-client just requires refactoring to use oidc-rp’s logoutRequest() method instead of logout(). (and send a POST to the resulting url)

@kidehen
Copy link

kidehen commented Oct 2, 2018

@dmitrizagidulin,

We are now back to oidc-op, which @cblakeley has been working on. Thus, can we triangulate back to the issue and PR combo that put an end to this issue.

/cc @RubenVerborgh @smalinin @kjetilk

@dmitrizagidulin
Copy link
Contributor

@kidehen Not quite, we’re not back to oidc-op. I was just saying that the correct fix has been already added to oidc-op and -rp. And the last step required is the refactor to auth client.

@kidehen
Copy link

kidehen commented Oct 2, 2018

@dmitrizagidulin ,

How do I compute

Not quite, we’re not back to oidc-op. I was just saying that the correct fix has been already added to oidc-op and -rp. And the last step required is the refactor to auth client. ?

Where is the correct fix bearing in mind the oidc-op and -rp fixes you mention?

My setup:

OIDC Relying Party (RP)

npm list @solid/oidc-rp
solid-server@4.1.4 /home/smalinin/node-solid-server-oidc
├─┬ @solid/oidc-auth-manager@0.16.4 (git+https://github.com/OpenLinkSoftware/oidc-auth-manager.git#045a256fb75040d8206bf0bb7ad034b725260dad)
│ └─┬ @solid/solid-multi-rp-client@0.4.4
│   └── @solid/oidc-rp@0.8.0  deduped
├─┬ @solid/solid-auth-oidc@0.3.0
│ └── @solid/oidc-rp@0.8.0 
└─┬ solid-auth-client@2.2.6 (git+https://github.com/OpenLinkSoftware/solid-auth-client.git#a68512b8a73780c00a0b1a7dedcf041f439e4b9a)
  └── @solid/oidc-rp@0.8.0  deduped

and

OIDC Provider

npm list @solid/oidc-op
solid-server@4.1.4 /home/smalinin/node-solid-server-oidc
├─┬ @solid/oidc-auth-manager@0.16.4 (git+https://github.com/OpenLinkSoftware/oidc-auth-manager.git#045a256fb75040d8206bf0bb7ad034b725260dad)
│ └── @solid/oidc-op@0.4.0  deduped
└── @solid/oidc-op@0.4.0 

I can only conclude that "refactoring" in the solid-auth-client is WIP, so our workaround stays until that work is completed, right?

/cc @smalinin @cblakeley @RubenVerborgh @kjetilk @justinwb

Copy link

@kidehen kidehen left a comment

Choose a reason for hiding this comment

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

Confirming authorization informed by ACLs is still working, based on current workaround.

Evidence:

  1. https://drive.verborgh.org/public/RWWCrewQA/RWWCrew%20Meeting%20by%20%40kidehen/ -- entries created across panes using one of my many WebIDs

@dmitrizagidulin
Copy link
Contributor

@kidehen

Where is the correct fix bearing in mind the oidc-op and -rp fixes you mention?

I'm referring to PRs nodeSolidServer/oidc-op#7 and nodeSolidServer/oidc-rp#6

so our workaround stays until that work is completed, right?

That seems reasonable to me. We can roll back the cookie changes in this PR afterwards, when the auth client refactor is merged.

@kjetilk
Copy link
Member

kjetilk commented Oct 2, 2018

OK, sounds good. @RubenVerborgh please merge at your discretion, we can then roll a release ASAP.

@RubenVerborgh RubenVerborgh force-pushed the fix/allow-subdomain-cookies branch from 389cd32 to 0a48614 Compare October 2, 2018 21:50
@RubenVerborgh
Copy link
Contributor Author

Thanks all!

@RubenVerborgh RubenVerborgh merged commit 051fe3e into develop Oct 2, 2018
@RubenVerborgh RubenVerborgh deleted the fix/allow-subdomain-cookies branch October 2, 2018 21:51
@RubenVerborgh
Copy link
Contributor Author

solid-auth-client fix so that cookies are no longer used in nodeSolidServer/solid-auth-client#70

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