The vulnerability is an authentication bypass for Server-Sent Events (SSE) endpoints in Dagu when basic authentication is enabled. The root cause was traced to the buildStreamAuthOptions function in internal/service/frontend/server.go. This function is responsible for generating the authentication configuration for streaming endpoints.
The analysis of the provided patch, commit 064616c9b80c04824c1c7c357308f77f3f24d775, confirms this. Before the patch, when the authentication mode was 'basic', the function returned an auth.Options struct without explicitly setting the AuthRequired field. In Go, boolean fields default to false. This misconfiguration was consumed by the authentication middleware, which then incorrectly allowed unauthenticated requests to access sensitive SSE endpoints.
The fix was to add the line AuthRequired: true within the auth.Options struct for the basic authentication case. This ensures that the authentication middleware correctly enforces credential checks for all SSE endpoints, mitigating the vulnerability.