You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So let's say i have following relation user <-groupMembers-> group, now if i allow group owner to query users, he can also include all user tokens, and login as user, nice.
@raymondfeng mentioned in the mailing list that one can disable includes in model/relation settings using the option disableInclude: true. Does that fix the problem?
Is it enough to change configuration of the built-in relation "User hasMany accessTokens" to prevent inclusion? Or is that just a workaround and we need to implement @raymondfeng proposal "the ACL will have to check the permissions for the included relations"?
The ability to access related objects via include is a large security hole. Essentially it makes the whole ACL useless as long as users can use the include filter.
I suggest to add a big warning on the include documentation page. In fact I think filter.include should be disabled by default until ACL deals with it.
I totally agree with @erikverheij . Include feature is a nice way to avoid multiple requests from the frontend but it is a must to be handled by ACL in order to have decent security. At the moment the only solution I can see is to use "disableInclude" for all models that needs to be blocked to at least one role (other than $everyone or $unauthorized) and access them with specific requests only allowed for specific roles
I think it works it that way pretty well. But, I think it shouldn't be as well. It should block the include calls from the client calls, but not from the internal use. It could facilitates some operations a lot!
Activity
raymondfeng commentedon Jul 20, 2014
Hmm, this is serious. I think the ACL will have to check the permissions for the included relations.
fabien commentedon Aug 23, 2014
@raymondfeng I believe this has been fixed, no?
grosem commentedon Mar 21, 2015
@fabien & @raymondfeng
I just tested it with the latest version and it is still possible. For example like this (manager is extending the User model):
http://localhost:3000/api/events?filter={"where":{"nr":1},"include":{"relation":"manager","scope":{"include":[{"relation":"accessTokens"}]}}}
https://groups.google.com/forum/#!topic/loopbackjs/8XmsoaHpNP4 seems to be the same problem.
fabien commentedon Mar 31, 2015
ping @raymondfeng @bajtos @ritch
bajtos commentedon Apr 1, 2015
@raymondfeng mentioned in the mailing list that one can disable includes in model/relation settings using the option
disableInclude: true. Does that fix the problem?Is it enough to change configuration of the built-in relation "User hasMany accessTokens" to prevent inclusion? Or is that just a workaround and we need to implement @raymondfeng proposal "the ACL will have to check the permissions for the included relations"?
grosem commentedon Apr 1, 2015
From my point of view this should definitely covered by ACL.
raymondfeng commentedon Apr 14, 2015
@bajtos User.hasMany accessTokens probably should have
disableIncludeset totrueby default.Set disableInclude for User->AccessToken relation
Set disableInclude for User->AccessToken relation
Set disableInclude for User->AccessToken relation
bajtos commentedon Apr 30, 2015
Closing the issue as fixed by #1318.
erikverheij commentedon Aug 13, 2015
The ability to access related objects via include is a large security hole. Essentially it makes the whole ACL useless as long as users can use the include filter.
I suggest to add a big warning on the include documentation page. In fact I think filter.include should be disabled by default until ACL deals with it.
fabien commentedon Aug 13, 2015
@erikverheij agreed, this should be handled with caution.
@raymondfeng @bajtos what do you think?
A workaround for now (from the top of my head) would be:
Shyri commentedon Sep 24, 2015
I totally agree with @erikverheij . Include feature is a nice way to avoid multiple requests from the frontend but it is a must to be handled by ACL in order to have decent security. At the moment the only solution I can see is to use "disableInclude" for all models that needs to be blocked to at least one role (other than $everyone or $unauthorized) and access them with specific requests only allowed for specific roles
ben-girardet commentedon Dec 19, 2015
Any chance that the ACL would handle this security issue in the future ?
dmisdm commentedon Mar 1, 2016
Has this issue essentially moved to #1362 ??
sebastianfelipe commentedon Jan 19, 2018
Can this "disableInclude" feature affect the client calls only and not the back-end side? Thanks.
bajtos commentedon Jan 22, 2018
@sebastianfelipe I believe this flag affects all calls, including JavaScript API. If you suspect it's not working that way, then please open a new issue and provide us with a small app reproducing the problem - see http://loopback.io/doc/en/contrib/Reporting-issues.html#bug-report
sebastianfelipe commentedon Jan 22, 2018
I think it works it that way pretty well. But, I think it shouldn't be as well. It should block the include calls from the client calls, but not from the internal use. It could facilitates some operations a lot!