Published 8 months ago
Published 8 months ago
Xyborg
Updated 8 months ago
0
A configuration-based authentication bypass vulnerability exists in the SafeLine WAF management interface that disables authentication when the NO_AUTH environment variable is set during deployment.
Severity: Medium
CVSS Score: 6.6 (Medium)
CWE: CWE-287 (Improper Authentication)
Affected Component: SafeLine Management Web Server
Affected File: management/webserver/main.go
The SafeLine management web server contains logic that bypasses authentication middleware when any NO_AUTH environment variable is present with a non-empty value . This appears to be intended for development or testing purposes but creates a potential security risk in production deployments.
If exploited through deployment configuration, this vulnerability would provide:
This vulnerability requires access to the deployment environment and is exploitable in these scenarios:
1# In Docker Compose deployment 2environment: 3 - NO_AUTH=1 4 5# Or via environment variable 6export NO_AUTH=true
Remove the authentication bypass logic entirely:
1limitedRouters := r.Group("/api") 2limitedRouters.Use(middleware.AuthRequired)
If needed for development, restrict to development environments:
1if os.Getenv("ENVIRONMENT") == "development" && os.Getenv("NO_AUTH") != "" { 2 logger.Warn("No auth - development mode only") 3} else { 4 limitedRouters.Use(middleware.AuthRequired) 5}
Base Score: 6.6 (Medium)
Discovered by: Martin Aberastegue / Torito
Note: While this vulnerability requires privileged access to exploit, it represents a configuration security risk that should be addressed to maintain defense-in-depth principles for a security product.
File: management/webserver/main.go (L162-167)
1 noAuth, existed := os.LookupEnv("NO_AUTH") 2 if existed && len(noAuth) >= 0 { 3 logger.Warn("No auth") 4 } else { 5 limitedRouters.Use(middleware.AuthRequired) 6 }
File: management/webserver/main.go (L174-188)
1 limitedRouters.GET(api.User, api.GetUser) 2 3 limitedRouters.GET(api.DetectLogList, api.GetDetectLogList) 4 limitedRouters.GET(api.DetectLogDetail, api.GetDetectLogDetail) 5 6 limitedRouters.POST(api.Website, api.PostWebsite) 7 limitedRouters.PUT(api.Website, api.PutWebsite) 8 limitedRouters.DELETE(api.Website, api.DeleteWebsite) 9 limitedRouters.GET(api.Website, api.GetWebsite) 10 11 limitedRouters.POST(api.UploadSSLCert, api.PostUploadSSLCert) 12 limitedRouters.POST(api.SSLCert, api.PostSSLCert) 13 14 limitedRouters.POST(api.PolicyRule, api.PostPolicyRule) 15 limitedRouters.PUT(api.PolicyRule, api.PutPolicyRule)
SpiderD555
Updated 7 months ago
0
Hi
Which version is that ?
To which container do you attach this environment variable ?
I tried with mgt and the management webpage still presented me with a login page.
As a regular homelab user I would argue that this may be a feature and not a bug (if it works), because then I would be able to put the management interface behind something like oauth proxy, and have a consistent SSO behavior across all my apps.