-
-
Notifications
You must be signed in to change notification settings - Fork 597
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
API: Endpoint for API docs needs session cookie #319
Comments
Ok, the problem is this line: |
If you add the version number to the I think security isn't an issue in this case. The returned JSON doesn't include any sensitive data. The only reason I can think of is, that you could determine the Kimai version and potentially use that information to exploit a bug which was only present in that specific Kimai version. |
I am closing this as I would prefer to not expose the API docs for unauthenticated users for now. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai. |
Describe the bug
Currently, you can not access the swagger API doc under
https://yourKimaiInstance.com/api/doc.json
without a valid session cookie. You need to generate this session cookie manually because the header fields "X-AUTH-USER" and "X-AUTH-TOKEN" don't work for this endpoint.In my opinion, the documentation endpoint shouldn't need any authentication.
To Reproduce
Steps to reproduce the behavior:
X-AUTH-USER
headerX-AUTH-TOKEN
headerGET
request tohttps://demo-v2.kimai.org/api/doc.json
Response:
If you execute a
GET
request using the authentication header to another endpoint (e.g /activities) a session cookie is created and the above/doc.json
request works.Expected behavior
The
/doc.json
should return the swagger documentation without authentication. If you think authentication is required, the headersX-AUTH-USER
andX-AUTH-TOKEN
need to work as expected.Additional context
As you know, I'm currently converting Timeu to support Kimai2 instead of Kimai v1. In the process of doing that I need to get the API version, to validate that the entered Kimai URL to their custom Kimai Instance is correct. With the legacy Kimai API I sent a request to the JSON-RPC-2.0 documentation (
core/json.php
) to get the version. Using that I could validate the entered Kimai URL.The text was updated successfully, but these errors were encountered: