Skip to content

Conversation

@zakaria-shahen
Copy link
Contributor

Disable SpringDoc by default to maintain alignment with Scalar (scalar/scalar#6781) and ensure that the default configuration follows secure-by-default principles.

@bnasslahsen bnasslahsen merged commit 1dc8483 into springdoc:main Oct 27, 2025
1 check failed
@bnasslahsen
Copy link
Collaborator

i have merged with the latest version.
We prefer to keep scalar enabled by default.
If someone, is interested to disable it - it can be changed through property.

bnasslahsen added a commit that referenced this pull request Oct 27, 2025
@zakaria-shahen
Copy link
Contributor Author

@bnasslahsen

Making it disabled by default would be better. You could introduce a new property like springdoc.scalar.enabled to allow users to enable or disable it, rather than relying on scalar.enabled.

From previous experience, I've found that people typically disable SpringDoc via springdoc.swagger-ui.enabled only in production profiles, without realizing for several months that their other endpoints remain exposed to the internet through /v3/api-docs.

You might say this is a noob mistake, but in reality, the mistake is made by principal-level developers, and it passes both internal and external penetration testing. No one catches it for months in production, until a curious junior developer (me at one of my previous companies) discovers it by accident.

There may still be other systems/companies where this issue hasn't been discovered yet, so it's better to disable it by default and ensure users familiarize themselves with your library before enabling it.

Note that I sent the same concern to Scalar via email, and they accepted it: scalar/scalar#6781 (Of course, I also sent the same concern to SpringDoc via email)

I agree with you that it may seem overkill, but when you look at it from the user's perspective, it makes sense.

Also, in 2024, the CVE board updated the CNA rules, including the following:

  • 4.1.4 Insecure default configuration settings SHOULD be determined to be vulnerabilities

So what do you think?

Thank you for your effort in providing the Spring ecosystem with this library which makes our lives easier.

zakaria-shahen added a commit to zakaria-shahen/springdoc-openapi that referenced this pull request Oct 30, 2025
bnasslahsen added a commit that referenced this pull request Nov 1, 2025
…because SpringDocs/Scalar is enabled by default (#3090) #3122
bnasslahsen added a commit that referenced this pull request Nov 2, 2025
…because SpringDocs/Scalar is enabled by default (#3090) #3122
@jimisola
Copy link

jimisola commented Nov 3, 2025

This change seems like a breaking change. Does not SpringDoc use semantic versioning?

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.

3 participants