Skip to main content

Dify CVE-2025-56157

CRITICAL
Use of Hard-coded Credentials (CWE-798)
2025-12-18 cve@mitre.org
9.8
CVSS 3.1 · Vendor: mitre
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify exposed Dify PostgreSQL on TCP 5432
  2. Delivery
    Retrieve default credentials from public docker-compose.yaml
  3. Exploit
    Authenticate directly to database
  4. Execution
    Read and modify all application data
  5. Impact
    Full 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).

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
No patch listed yet 0.8% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

Vendor (mitre) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 8.1 HIGH

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.8%
Top 47% exploitable
Prevalence
Medium
popular open-source LLM app platform, common in AI dev deployments but not universal
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.8%
Patch available No
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

70
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +49
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Affected Products (CPE)CVE.org

cpe:2.3:a:langgenius:dify:*:*:*:*:*:node.js:*:*

More in Dify

View all
CVE-2025-63387 MEDIUM POC
4.3 Dec 18

Dify 1.9.1 permits unauthenticated remote GET requests to the /console/api/system-features console endpoint, letting ano

CVE-2026-41948 CRITICAL POC
9.3 May 18

Path traversal in Dify versions 0 through 1.14.1 allows authenticated tenants to escape their authorized tenant path and

CVE-2026-41947 CRITICAL POC
9.3 May 18

Cross-tenant authorization bypass in LangGenius Dify versions through 1.14.1 lets any logged-in editor reroute another t

CVE-2025-1796 HIGH POC
8.8 Mar 20

A vulnerability in langgenius/dify v0.10.1 allows an attacker to take over any account, including administrator accounts

CVE-2026-61461 HIGH POC
8.7 Jul 10

SQL injection in Dify's MyScale vector store backend (versions before 1.16.0-rc1) lets authenticated attackers execute a

CVE-2025-67732 HIGH POC
8.4 Jan 05

Plaintext exposure of third-party service API keys in Dify prior to version 1.11.0 allows any authenticated non-administ

CVE-2026-41949 HIGH POC
8.2 May 18

Cross-tenant document disclosure in Dify 1.14.1 and prior allows any authenticated user to read up to 3,000 characters o

CVE-2024-12039 HIGH POC
8.1 Mar 20

langgenius/dify version v0.10.1 contains a vulnerability where there are no limits applied to the number of code guess a

CVE-2024-12776 HIGH POC
8.1 Mar 20

In langgenius/dify v0.10.1, the `/forgot-password/resets` endpoint does not verify the password reset code, allowing an

CVE-2025-43862 HIGH POC
7.6 Apr 25

Dify is an open-source LLM app development platform. Rated high severity (CVSS 7.6), this vulnerability is remotely expl

CVE-2024-11824 HIGH POC
7.6 Mar 20

A stored cross-site scripting (XSS) vulnerability exists in langgenius/dify version latest, specifically in the chat log

CVE-2024-11822 HIGH POC
7.5 Mar 20

langgenius/dify version 0.9.1 contains a Server-Side Request Forgery (SSRF) vulnerability. Rated high severity (CVSS 7.5

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy