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 }}
Repository navigation
Local API accepts requests from other sites through simple requests and DNS rebinding #1070
The API has no authentication and accepts any Host header. #1063 replaces the wildcard CORS policy with an allowlist, which stops other sites from reading responses, but other sites can still reach the API in two ways.
DNS rebinding. A site can rebind its own host name to 127.0.0.1 after the page loads and become same origin with the API. Since any Host header is accepted (no TrustedHostMiddleware, only CORSMiddleware in app.py#L148-L154), that page can then call every endpoint and read the answers, including the file reads in Generative image, dataset and component image endpoints read files outside their folders #1067. Confirmed that a request with Host: attacker.example is served.
Docker binds every interface.Dockerfile#L15 and Dockerfile.cuda set DASHAI_HOST=0.0.0.0, which exposes the unauthenticated API to the whole network.
The desktop default (127.0.0.1, main.py#L136-L140) is right and should stay.
Suggested fix
Add TrustedHostMiddleware allowing 127.0.0.1, localhost and hosts from a setting for Docker or server deployments.
Require a per launch secret on API requests that a foreign page cannot obtain, for example a SameSite=StrictHttpOnly cookie set when the backend serves the app (this keeps image URLs, downloads and the pywebview window working), with a documented token for Docker or server setups.
Document that binding 0.0.0.0 needs a reverse proxy with authentication.
Activity