-
Notifications
You must be signed in to change notification settings - Fork 27
Publicly Accessible API Documentation via Swagger vulnerability remediation doc #48
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Swagger API Security Updates | ||
|
|
||
| ## Overview | ||
| This document outlines the changes made to address potential vulnerabilities related to the Swagger API documentation in the Doubtfire application. | ||
|
|
||
| ## Potential Impact if Unfixed | ||
| If this vulnerability is not addressed, unauthorized users could access the Swagger API documentation in production environments, potentially exposing sensitive API details. This could lead to: | ||
| - Unauthorized access to API endpoints. | ||
| - Increased risk of exploitation of unprotected or misconfigured endpoints. | ||
| - Leakage of sensitive information about the API structure and functionality. | ||
|
|
||
| ## Changes Implemented | ||
|
|
||
| ### 1. Disable Swagger in Production | ||
| - Swagger API documentation is now disabled in production environments as it is only needed during development. | ||
| - **Action Taken:** Added a conditional check in the Swagger initializer to ensure that Swagger is only accessible in development environments. | ||
|
|
||
| ### Context for the Decision | ||
| - During testing, I attempted to access Swagger documentation on the production site by manipulating the URL to `https://ontrack.deakin.edu.au/home/api/swagger_doc.json` and `https://ontrack.deakin.edu.au/home/swagger_doc.json`. However, I observed that any such attempts were redirected back to `https://ontrack.deakin.edu.au/home`, indicating that Swagger is not needed in production or there are additional protective meassures not included in the Thothtech vesrion of Ontrack. | ||
|
|
||
| ## Affected Components | ||
| The following components and files were updated as part of this security enhancement: | ||
| - **doubtfire-api:** | ||
| - Updated the Swagger initializer to disable Swagger in production. | ||
| - **Affected file:** `config/initializers/swagger.rb` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can add the changed or the newly added code segment to signify the difference.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not good practice to reveal security code in documentation, as it gives attackers knowledge on how to circumvent them. |
||
|
|
||
| ## Recommendations | ||
| - Regularly review and update API documentation tools to ensure they are secure. | ||
| - Continuously monitor for vulnerabilities in third-party libraries and implement patches promptly. | ||
| - **Additional Security Measures:** | ||
| - Enforce authentication and authorization for accessing API documentation if needed in non-development environments. | ||
| - Log and monitor access to the Swagger endpoint to detect unauthorized attempts. | ||
|
|
||
| ## References | ||
| - [Swagger Security Best Practices](https://swagger.io/docs/security/) | ||
| - [OWASP API Security Top 10](https://owasp.org/www-project-api-security/) | ||
|
|
||
| ## Version History | ||
| - **Version:** 1.2 | ||
| - **Date:** 08/20/2025 | ||
| - **Author:** Ibitope Fatoki | ||
Uh oh!
There was an error while loading. Please reload this page.