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
{{ message }}
Repository navigation
/models and /routes Exposed To All Environments #1124
I'm pretty curious as to why /models and /routes are exposed to all environments (in most cases, it would be at /api/models and /api/routes. Maybe this is something that could be useful for some sort of development/tooling purpose but I struggle a bit to find a reason why this is open.
To compound the issue, how it's implemented you can make any request type to the endpoint including GET, POST, PUT, DELETE.
If there is a valid reason to keep these endpoints exposed, at the minimum an option should be made available to toggle the visibility.
My questioning of the role these endpoints serve don't exactly invalidate the security implications here.
Take /api/routes for example, the response exposes all public endpoints including, HTTP method, accepted parameters and the loopback method that is invoked. I can't think of one good use case on why I would ever want to do this on a public facing site. This just seems like an open invitation for potential abuse.
The fact I can GET, POST, PUT and DELETE to these endpoints concerns me as well, that's not consistent with a feature/functionality that's been completely thought through.
Initially I thought this was something that was part of/consumed by loopback-explorer but that doesn't seem to be the case.
Whatever role they serve, the potential for abuse seems pretty high.
@bajtos you've be helpful with previous issues I've reported and contributed to before, could you please weigh in on this one? Maybe I'm way off the mark with this one but would like your input before dismissing the validity of this ticket.
Here are some sample responses to review from a clean LB app with a Widget model added.
Whatever role they serve, the potential for abuse seems pretty high.
These are used (or at least were) by the explorer. We should support some option to remove them or even better just move them to the explorer middleware and then if you disable the explorer you disable these routes.
I'm closing this issue in favor of an actionable one: #1134
Activity
greaterweb commentedon Feb 24, 2015
Temporary fix to disable the routes:
If default, generated loopback setup which includes
/server/boot/rest-api.js:superkhau commentedon Feb 25, 2015
Please post questions at https://groups.google.com/forum/#!forum/loopbackjs.
greaterweb commentedon Feb 25, 2015
Ouch.
My questioning of the role these endpoints serve don't exactly invalidate the security implications here.
Take
/api/routesfor example, the response exposes all public endpoints including, HTTP method, accepted parameters and the loopback method that is invoked. I can't think of one good use case on why I would ever want to do this on a public facing site. This just seems like an open invitation for potential abuse.The fact I can
GET,POST,PUTandDELETEto these endpoints concerns me as well, that's not consistent with a feature/functionality that's been completely thought through.Initially I thought this was something that was part of/consumed by loopback-explorer but that doesn't seem to be the case.
Whatever role they serve, the potential for abuse seems pretty high.
@bajtos you've be helpful with previous issues I've reported and contributed to before, could you please weigh in on this one? Maybe I'm way off the mark with this one but would like your input before dismissing the validity of this ticket.
Here are some sample responses to review from a clean LB app with a
Widgetmodel added.bajtos commentedon Feb 25, 2015
I agree the security implications should be considered.
@raymondfeng @ritch do you remember why these routes were added?
@greaterweb Would you mind contributing the toggle for disabling these routes yourself?
ritch commentedon Feb 25, 2015
These are used (or at least were) by the explorer. We should support some option to remove them or even better just move them to the explorer middleware and then if you disable the explorer you disable these routes.
I'm closing this issue in favor of an actionable one: #1134