Skip to content

Conversation

@ibi420
Copy link
Contributor

@ibi420 ibi420 commented Aug 20, 2025

Description

This change addresses a vulnerability where Swagger API documentation was publicly accessible in production environments. Swagger has now been disabled in production to prevent unauthorised users from discovering sensitive backend routes and internal API details.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Attempted to access Swagger documentation endpoints (/api/swagger_doc.json, /swagger_doc.json) in a production environment.
  • Verified that requests are redirected to the homepage (/home) and Swagger documentation is no longer exposed.
  • Confirmed that Swagger remains available and functional in development environments for testing and debugging purposes.

Testing Checklist

  • Tested in latest Chrome

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have requested a review from security and project maintainers on the Pull Request

@netlify
Copy link

netlify bot commented Aug 20, 2025

Deploy Preview for ontrackdocumentation failed.

Name Link
🔨 Latest commit c5f45dc
🔍 Latest deploy log https://app.netlify.com/projects/ontrackdocumentation/deploys/68c8fdf8821e7600084e399b

@ibi420 ibi420 marked this pull request as draft August 20, 2025 11:42
Copy link
Contributor

@martindolores martindolores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation looks good to me! Not sure if this one is ready as you have put it in draft?

@ibi420 ibi420 marked this pull request as ready for review August 28, 2025 06:45
Copy link
Contributor

@martindolores martindolores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work :)

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`

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

@WaelAlahamdi
Copy link

Hi @ibi420, I have reviewed the documentation, and everything looks good. No further comments from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants