Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

RestAPI: info end point is public

Open jamie-owen opened this issue 10 years ago • 3 comments

Your Rocket.Chat version: 0.35.0

Whilst I was looking at the API I noticed that the 'info' endpoint is available without authenticating, it should probably require authentication as it returns various information about the build that system administrators would rather keep private.

Easy to remedy, PR incoming.

jamie-owen avatar Jun 29 '16 09:06 jamie-owen

If anyone wants to take a step on this, see comments on the PR: https://github.com/RocketChat/Rocket.Chat/pull/3652#issuecomment-229358245

marceloschmidt avatar Feb 03 '17 13:02 marceloschmidt

@marceloschmidt @graywolf336 according to their documentation, as soon as you set authRequired to true, it responds with a 401 when unauthenticated. The change I have come up with may need some consideration and could probably be done a little better -- essentially, we default with a response of info.version number (that solves for the mobile clients), and if there is a header with a user-id, we use that to check if their role is admin. If so, show the rest of the data. I can commit what I've got so you can see.

jaredhilton avatar Feb 07 '17 04:02 jaredhilton

Hello @jaredhilton thanks for helping out on this one. Please create a pull request with your solution! We'd love to see what you've come up with. Thanks!

marceloschmidt avatar Feb 07 '17 10:02 marceloschmidt