# CVE-2025-56157: LangGenius Dify hardcoded credentials in PostgreSQL Docker configuration

Source: https://junglewise.ai/threats/cve-2025-56157-langgenius-dify-hardcoded-credentials-in-postgresql-docker  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-12-18. Updated: 2026-07-05  
License: CC BY 4.0 with a link back

CVE-2025-56157 · Severity: critical · CVSS 9.8 · Published 2025-12-18

Dify, an AI application development platform, was found to use hardcoded default credentials for its internal PostgreSQL database within its standard Docker deployment configuration. If the database port is exposed to the internet, an attacker could use these known credentials to gain full access to the database. This could result in the theft of sensitive application data, unauthorized modification of information, or potential service disruption.

Technologies: [Langgenius Dify](https://junglewise.ai/threats/technologies/dify). Vendors: [Langgenius](https://junglewise.ai/threats/vendors/langgenius).

## Quick answers

**Is CVE-2025-56157 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-56157 being exploited in the wild.

**How severe is CVE-2025-56157?** Critical severity, with a CVSS score of 9.8, published 18 December 2025.

**Which products and versions are affected?** Langgenius Dify up to and including 1.5.1.

**Is there a fix for CVE-2025-56157?** A patch was published on 2025-03-10: Port exposure removed in version 1.0.1; credentials remained hardcoded Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-56157 attacked?** It is attacked over the network, in a network appliance.

**Am I affected by CVE-2025-56157?** Check whether you run Langgenius Dify at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

Dify versions up to and including 1.5.1 utilize hardcoded default credentials (username and password) for PostgreSQL within the `docker-compose.yaml` and `docker-compose-template.yaml` files. In versions prior to 1.0.1, the Docker configuration also explicitly exposed PostgreSQL on TCP port 5432 to all network interfaces (0.0.0.0) by default. An unauthenticated remote attacker can connect to the database using these default credentials if the port is reachable. Successful exploitation allows for full database compromise, including data exfiltration and potential remote code execution on the container. While version 1.0.1 removed the default port exposure, the hardcoded credentials remained in subsequent versions through 1.5.1, requiring manual rotation by users.

## Affected products

- LangGenius Dify up to and including 1.5.1

## Timeline

- 2025-03-08: disclosed: Issue regarding default port exposure reported on GitHub
- 2025-03-10: patched: Port exposure removed in version 1.0.1; credentials remained hardcoded
- 2025-12-18: advisory: CVE-2025-56157 published

## References

- [https://gist.github.com/Cristliu/216ddbadaf3258498c93d408683ecabd](https://gist.github.com/Cristliu/216ddbadaf3258498c93d408683ecabd)
- [https://gist.github.com/Cristliu/298f51cbc72c45d91632cd0d65aa8161](https://gist.github.com/Cristliu/298f51cbc72c45d91632cd0d65aa8161)
- [https://github.com/langgenius/dify](https://github.com/langgenius/dify)
- [https://github.com/langgenius/dify/issues/15285](https://github.com/langgenius/dify/issues/15285)
- [https://github.com/langgenius/dify/pull/15286](https://github.com/langgenius/dify/pull/15286)
- [https://github.com/langgenius/dify/pull/15286.diff](https://github.com/langgenius/dify/pull/15286.diff)
- [https://github.com/langgenius/dify/releases/tag/1.0.1](https://github.com/langgenius/dify/releases/tag/1.0.1)

## Related threats

- [langgenius dify hard-coded credentials in sandbox](https://junglewise.ai/threats/cve-2026-123135-a-vulnerability-was-found-in-langgenius-dify-up-to-1-18-0-2-0-0)
- [Dify authorization bypass in MCP server endpoint](https://junglewise.ai/threats/cve-2026-105761-dify-is-an-open-source-llm-app-development-platform-prior-to-1)
- [langgenius dify DOM-based XSS in redirect URL handler](https://junglewise.ai/threats/cve-2026-85022-langgenius-dify-dom-based-xss-in-redirect-url-handler)
- [langgenius Dify DOM-based XSS in splash.tsx redirect](https://junglewise.ai/threats/cve-2026-85021-langgenius-dify-dom-based-xss-in-splash-tsx-redirect)
- [LangGenius Dify server-side template injection in Jinja2 handler](https://junglewise.ai/threats/cve-2026-18632-langgenius-dify-server-side-template-injection-in-jinja2-handler)
