You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2026. It is now read-only.
Swagger/OpenAPI documentation UI is unconditionally enabled for all environments, including production. This exposes the full API surface, endpoint schemas, and parameter details to potential attackers.
Description
In src/Program.cs (lines 121–122):
app.UseSwagger();app.UseSwaggerUI();
These calls are not wrapped in an environment check. In production:
Attackers can browse the full API schema at /swagger.
All endpoint parameters, types, and response shapes are visible.
This information aids in crafting targeted attacks against the API.
Internal or admin endpoints (like DELETE /api/v1/gods) are publicly documented.
Implementation
Wrap Swagger registration in a development environment check:
Summary
Swagger/OpenAPI documentation UI is unconditionally enabled for all environments, including production. This exposes the full API surface, endpoint schemas, and parameter details to potential attackers.
Description
In
src/Program.cs(lines 121–122):These calls are not wrapped in an environment check. In production:
/swagger.DELETE /api/v1/gods) are publicly documented.Implementation
ASPNETCORE_ENVIRONMENT=Productionand confirming/swaggerreturns 404.References
src/Program.cs, lines 121–122 — unconditional Swagger registration