A Cross-Origin Resource Sharing (CORS) misconfiguration vulnerability exists in Dify v1.9.1 in the /console/api/setup endpoint. The endpoint implements an insecure CORS policy that reflects any Origin header and enables Access-Control-Allow-Credentials: true, permitting arbitrary external domains to make authenticated requests. NOTE: the Supplier disputes this because the endpoint configuration is intentional to support bootstrap.
The /console/api/setup endpoint reflects any value of the Origin header passed by the client and simultaneously returns the Access-Control-Allow-Credentials: true header. This means that the victim's browser will accept the response from any domain controlled by the attacker, including session cookies or other authentication data in the request. An attacker can thus trick a logged-in user into visiting a malicious website that performs an authenticated request to the endpoint in the background. The manufacturer disputes the report, indicating that such configuration is intentional to support the initialization (bootstrap) process.
An attacker can exploit this vulnerability to gain unauthorized access to sensitive data (confidentiality breach) and to modify application configuration (integrity breach) in the context of the victim's authenticated session.
Patches available from the manufacturer should be applied in accordance with the references (see pull request #32224 in the langgenius/dify GitHub repository). It is recommended to restrict the list of allowed origins in the CORS configuration to trusted domains only instead of dynamically reflecting the Origin header, and also to consider disabling the Access-Control-Allow-Credentials flag for publicly accessible endpoints without authentication.
Langgenius Dify v1.9.1 — /console/api/setup endpoint
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NLanggenius Dify
APPLanggenius1.9.1
Related vulnerabilities
Domyślne dane uwierzytelniające PostgreSQL w Langgenius Dify
Błędna konfiguracja CORS w Dify — nieograniczony dostęp cross-origin z uwierzytelnieniem
Dify v1.9.1 is vulnerable to Insecure Permissions. An unauthenticated attacker can directly send HTTP GET requ...
langgenius/dify versions 1.1.0 to 1.1.2 are vulnerable to unsanitized input in the code node, allowing executi...
Dify is an open-source LLM app development platform. Prior to version 0.6.12, a normal user is able to access ...