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
By using * as the value for these CORS headers that means that any website a user loads could make a request to dagu under certain conditions and be a pathway for remote code execution (as code execution is the purpose of dagu)
My assumption is that these overly-lax headers were added to support development of the UI on a separate port for quick iteration
If this was indeed the reason for these lax CORS headers, my recommendation would be to use the Webpack Dev Serer proxy feature built into the dev server. This will allow the browser to make requests dev server on port 8081 and have those requests forwarded to port 8080 bypassing any CORS related issues.
The CORS headers in dagu should either be deleted, or be configurable with a default "secure" setting of "off". In almost no cases would we want such a lax policy of *. If CORS headers are needed and configuration a user could configure them to the specific origin they trust and wish to have access.
Thanks for raising this important security concern! You're absolutely right, allowing any origin via the * wildcard in CORS headers presents a significant security risk, especially given dagu's purpose of code execution. Will address this issue in the earliest convenience.
There are CORS headers that allow any Origin to make a request to dagu
dagu/internal/frontend/middleware/global.go
Lines 122 to 133 in e66978d
dagu/internal/frontend/middleware/global.go
Line 28 in e66978d
By using
*
as the value for these CORS headers that means that any website a user loads could make a request to dagu under certain conditions and be a pathway for remote code execution (as code execution is the purpose of dagu)My assumption is that these overly-lax headers were added to support development of the UI on a separate port for quick iteration
dagu/ui/webpack.dev.js
Lines 10 to 13 in e66978d
If this was indeed the reason for these lax CORS headers, my recommendation would be to use the Webpack Dev Serer proxy feature built into the dev server. This will allow the browser to make requests dev server on port 8081 and have those requests forwarded to port 8080 bypassing any CORS related issues.
The CORS headers in dagu should either be deleted, or be configurable with a default "secure" setting of "off". In almost no cases would we want such a lax policy of
*
. If CORS headers are needed and configuration a user could configure them to the specific origin they trust and wish to have access.To illustrate, the attack would look like this:
If docker is exposed to dagu this would also give the attacker root level privileges.
The text was updated successfully, but these errors were encountered: