Clarify disclosure and vulnerability risks for OpenAPI UIs #34817
Labels
aspnet-core/svc
fundamentals/subsvc
seQUESTered
Identifies that an issue has been imported into Quest.
Source - Docs.ms
Docs Customer feedback via GitHub Issue
Description
The page currently states:
However, this recommendation is only highlighted for Swagger UI, even though
ReDoc
andScalar
are also mentioned.Are there particular reasons you consider "Swagger UI" to be more vulnerable than say
Scalar
orReDoc
?"information disclosure" and "security vulnerability" are a bit vague. - Simply exposing Swagger UI should in general (barring supply chain attacks) not have any impact one way or another on the actual security of your endpoints.
Swagger UI
,ReDoc
orScalar
, then they can already take advantage of those vulnerabilities by calling the same endpoint withoutSwagger UI
,Redoc
orScalar
availableIf you're concerned about listing all endpoints - then you should also be concerned about
MapOpenApi()
callsI can see a potential case for concerns about supply-chain attacks (e.g. if a malicious update were pushed to Swagger, it could potentially be used to access things such as authorization cookies, and damage would be limited by only enabling in environments without production data), but that is a general concern with all third-party code.
There may be some value in allowing certain power users to access the e.g. Swagger UI, so perhaps show an example of authorizing the Swagger UI / Redoc / Scalar / OpenAPI spec for certain users, or state more explicitly why you consider this to be a really bad idea.
So in summary, I'm suggesting:
Don't single out "Swagger UI" unless you have specific reasons that you consider it more risky than other Open API UIs
More clearly explain what the actual risks are
Page URL
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/using-openapi-documents?view=aspnetcore-9.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/openapi/using-openapi-documents.md
Document ID
472b10ab-681b-f631-040d-025ef0a02329
Article author
@captainsafia
Metadata
Related Issues
Associated WorkItem - 400564
The text was updated successfully, but these errors were encountered: