Forceu / Gokapi

Lightweight selfhosted Firefox Send alternative without public upload. AWS S3 supported.
GNU Affero General Public License v3.0
1.71k stars 69 forks source link

[Security] Restrict Access to /apidocumentation Endpoint #182

Closed adripo closed 5 months ago

adripo commented 5 months ago

Description:

The /apidocumentation endpoint is currently accessible to all users, regardless of their authentication status. Exposing API documentation to unauthenticated users can lead to security risks.

Security Implications:

Allowing public access to API documentation can provide malicious actors with detailed information about the application's API endpoints, parameters, and expected responses. This information can be leveraged to discover potential vulnerabilities and devise attacks.

Recommendation:

To mitigate this risk, it is recommended to restrict access to the /apidocumentation endpoint so that only authenticated users can view the API documentation. This ensures that sensitive information about the API is not exposed to unauthorized users.

Forceu commented 5 months ago

There is no user-facing direct link to the documentation. As this an open source project, they could simply access the openapi.json in the project repository.

The API interaction requires authorisation and therefore this is not a security issue.

adripo commented 5 months ago

Thank you for your prompt response and for the clarification @Forceu .

While it's true that there is no user-facing direct link to the documentation and that the project is open source, I believe that restricting access to the '/apidocumentation' endpoint could still provide additional security benefits. Here are a few points for consideration:

I appreciate your consideration of this recommendation. If you still believe that no changes are necessary, I understand and respect that decision. Thank you for all your hard work on this project.