Dify
CVE-2025-56157
CRITICAL
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify exposed Dify PostgreSQL on TCP 5432
-
DeliveryRetrieve default credentials from public docker-compose.yaml
-
ExploitAuthenticate directly to database
-
ExecutionRead and modify all application data
-
ImpactFull backend data compromise
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Credential externalization
MITRE ATT&CK
2 techniques across 2 tactics: Persistence, Credential Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the PostgreSQL service on TCP 5432 be reachable by the attacker AND that the default credentials from docker-compose.yaml remain unchanged. The critical limiting factor, stated by the supplier, is that in Dify 1.0.1 and later the Docker configuration does NOT expose PostgreSQL on port 5432 by default - so remote exploitation depends on either running a version prior to 1.0.1 or an administrator having manually published/forwarded the database port. No user interaction is needed, and no application authentication is required beyond the known static DB credentials; the effective barrier is network exposure of the database port, not authentication. |
| Impact | The NVD CVSS 9.8 (AV:N/AC:L/PR:N/UI:N/C:H/I:H/A:H) presents this as a trivially remote, unauthenticated total compromise, but the signals conflict. EPSS is only 0.81% (53rd percentile) and the vulnerability is not in CISA KEV, indicating no evidence of widespread active exploitation despite public POC code. Most importantly, the supplier explicitly states that Docker does not expose PostgreSQL on port 5432 by default in version 1.0.1 or later - this directly contradicts the AV:N/AC:L/PR:N assumption for default deployments, since a network attacker cannot reach the database unless an operator has manually published the port. The genuine high-risk population is therefore legacy pre-1.0.1 deployments or any deployment where administrators have deliberately exposed 5432. Verify actual port exposure before treating this as a critical remote issue; for hardened default installs the practical risk is substantially lower than the base score suggests. |
| Exploit ScenarioDerived | An operator deploys Dify from the provided docker-compose stack on a cloud host and publishes port 5432 (or runs a pre-1.0.1 release that mapped it by default). An attacker who knows the hard-coded credentials from the public repository connects directly to PostgreSQL over the network and gains full read/write access to all application data. Public POC/exploit code for this technique is available (referenced gist). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 05, 2026
Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 allow anyone who can reach the database port to authenticate with full read/write access to the backend datastore. Publicly available exploit code exists, though EPSS remains low (0.81%) and the vendor states the database port is not network-exposed by default in 1.0.1 and later, limiting realistic reach. There is no public exploit identified as actively used in the wild (not in CISA KEV).
RemediationAI
Upgrade to Dify 1.0.1 or later (https://github.com/langgenius/dify/releases/tag/1.0.1), where the Docker configuration no longer exposes PostgreSQL by default; the corresponding change is in PR https://github.com/langgenius/dify/pull/15286 . Because the underlying default credentials still ship in docker-compose.yaml, also rotate the PostgreSQL username and password to unique strong values in your .env/compose configuration rather than relying on the shipped defaults. As compensating controls, ensure port 5432 is not published to any untrusted network (remove the ports mapping so the DB is only reachable on the internal Docker network - side effect: you lose direct external DB tooling access), and restrict host firewall rules to block inbound 5432 from outside the Docker host. These controls close the network path even where the default credentials remain unchanged.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Dify is an open-source LLM application development platform (langgenius/dify, Node.js/Python stack) that ships a docker-compose deployment bundling a PostgreSQL 15 container. The root cause is CWE-798 (Use of Hard-Coded Credentials): the docker-compose.yaml embeds a static, well-known PostgreSQL username and password in its source repository, so every default deployment that leaves these values unchanged shares identical database credentials. PostgreSQL listens on TCP 5432; the vulnerability is only remotely reachable if that port is published to an accessible network, which the supplier reports is no longer the default mapping in releases 1.0.1 and later.
Know when Dify gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Static credentials give full DB compromise (C/I/A:H) with no auth, but AC:H because default configs (1.0.1+) do not expose port 5432, requiring non-default network exposure.
Primary rating from Vendor (mitre).
CVSS VectorVendor: mitre
DescriptionCVE.org
Default credentials in Dify thru 1.5.1. PostgreSQL username and password specified in the docker-compose.yaml file included in its source code. NOTE: the Supplier reports that the Docker configuration does not make PostgreSQL (on TCP port 5432) exposed by default in version 1.0.1 or later.
Executive ViewAI
Dify versions through 1.5.1 ship with hard-coded PostgreSQL credentials in docker-compose.yaml, potentially exposing the backend database to complete read/write access from any system with network access to the database port. While the database port is not exposed to the internet by default in recent versions, misconfiguration, lateral network access, or insider threats could grant attackers full control over application data and configurations. This represents a critical data-access risk that organizations must address immediately regardless of version.
Rotate all PostgreSQL credentials from defaults to strong, unique values; implement firewall rules restricting database port access to application tier only; verify and maintain network isolation of the database port; enable database connection logging and monitor for unauthorized access attempts; disable any remote access to the PostgreSQL port; conduct regular network scans to confirm database port remains unexposed.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Affected Products (CPE)CVE.org
Dify 1.9.1 permits unauthenticated remote GET requests to the /console/api/system-features console endpoint, letting ano
Path traversal in Dify versions 0 through 1.14.1 allows authenticated tenants to escape their authorized tenant path and
Cross-tenant authorization bypass in LangGenius Dify versions through 1.14.1 lets any logged-in editor reroute another t
A vulnerability in langgenius/dify v0.10.1 allows an attacker to take over any account, including administrator accounts
SQL injection in Dify's MyScale vector store backend (versions before 1.16.0-rc1) lets authenticated attackers execute a
Plaintext exposure of third-party service API keys in Dify prior to version 1.11.0 allows any authenticated non-administ
Cross-tenant document disclosure in Dify 1.14.1 and prior allows any authenticated user to read up to 3,000 characters o
langgenius/dify version v0.10.1 contains a vulnerability where there are no limits applied to the number of code guess a
In langgenius/dify v0.10.1, the `/forgot-password/resets` endpoint does not verify the password reset code, allowing an
Dify is an open-source LLM app development platform. Rated high severity (CVSS 7.6), this vulnerability is remotely expl
A stored cross-site scripting (XSS) vulnerability exists in langgenius/dify version latest, specifically in the chat log
langgenius/dify version 0.9.1 contains a Server-Side Request Forgery (SSRF) vulnerability. Rated high severity (CVSS 7.5
NVD
CVE.org
EPSS
GitHub
Exploit-DB