ghsa-8j63-96wh-wh3j
Vulnerability from github
Project Address: Project Address 1Panel
Official website: https://www.1panel.cn/
Time: 2025 07 26
Version: 1panel V2.0.5
Vulnerability Summary
- First, we introduce the concepts of 1panel v2 Core and Agent. After the new version is released, 1panel adds the node management function, which allows you to control other hosts by adding nodes.
- The HTTPS protocol used for communication between the Core and Agent sides did not fully verify the authenticity of the certificate during certificate verification, resulting in unauthorized interfaces. The presence of a large number of command execution or high-privilege interfaces in the 1panel led to RCE.
Code audit process
- First we go to the Agent HTTP routing fileagent/init/router/router.go
- It was found that the Routersreference function in the function Certificatewas globally checked.agent/middleware/certificate.go
- The discovery Certificatefunction determines c.Request.TLS.HandshakeCompletewhether certificate communication has been performed
- Since c.Request.TLS.HandshakeCompletethe true or false judgment is determined by agent/server/server.gothe code Startfunctiontls.RequireAnyClientCert
Note::Here due to the use of tls.RequireAnyClientCert instead of tls.RequireAndVerifyClientCert,RequireAnyClientCert Only require the client to provide a certificate,Does not verify the issuance of certificates CA,So any self assigned certificate will pass TLS handshake。
- The subsequent Certificatefunction only verified that the CN field of the certificate was panel_client, without verifying the certificate issuer. Finally, it was discovered that the WebSocket connection could bypass Proxy-ID verification.
-
Process WebSocket interface (based on the above questions, all processes and other sensitive information can be obtained) routing address: /process/ws the request format is as follows
{ "type": "ps", // 数据类型: ps(进程), ssh(SSH会话), net(网络连接), wget(下载进度) "pid": 123, // 可选,指定进程ID进行筛选 "name": "process_name", // 可选,根据进程名筛选 "username": "user" // 可选,根据用户名筛选 }
-
Terminal SSH WebSocket interface (according to the above problem, any command can be executed) routing address: /hosts/terminal the request format is as follows
{ "type": "cmd", "data": "d2hvYW1pCg==" // "whoami" 的base64编码,记住不要忘记回车。 }
-
Container Terminal WebSocket interface (container execution command interface) routing address:/containers/terminal
-
File Download Process WebSocket interface (automatically push download progress information) routing address:/files/wget/process
Attack process
-
First generate a fake certificate openssl req -x509 -newkey rsa:2048 -keyout panel_client.key -out panel_client.crt -days 365 -nodes -subj "/CN=panel_client"
-
Then use the certificate to request verification. If the websocket interface is successfully connected, there is a vulnerability.
{ "affected": [ { "package": { "ecosystem": "Go", "name": "github.com/1Panel-dev/1Panel/core" }, "ranges": [ { "events": [ { "introduced": "1.0.0" }, { "fixed": "2.0.6" } ], "type": "ECOSYSTEM" } ] }, { "package": { "ecosystem": "Go", "name": "github.com/1Panel-dev/1Panel/core" }, "ranges": [ { "events": [ { "introduced": "0" }, { "fixed": "0.0.0-20250730021757-04b9cbd87a15" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2025-54424" ], "database_specific": { "cwe_ids": [ "CWE-295", "CWE-77" ], "github_reviewed": true, "github_reviewed_at": "2025-08-01T18:10:21Z", "nvd_published_at": "2025-08-01T23:15:24Z", "severity": "HIGH" }, "details": "### Project Address: Project Address [1Panel](https://github.com/1Panel-dev/1Panel)\n### Official website: https://www.1panel.cn/\n### Time: 2025 07 26\n### Version: 1panel V2.0.5\n### Vulnerability Summary\n - First, we introduce the concepts of 1panel v2 Core and Agent. After the new version is released, 1panel adds the node management function, which allows you to control other hosts by adding nodes.\n - The HTTPS protocol used for communication between the Core and Agent sides did not fully verify the authenticity of the certificate during certificate verification, resulting in unauthorized interfaces. The presence of a large number of command execution or high-privilege interfaces in the 1panel led to RCE.\n\n\n\n### Code audit process\n\n1. First we go to the Agent HTTP routing fileagent/init/router/router.go\n\n\n\n2. It was found that the Routersreference function in the function Certificatewas globally checked.agent/middleware/certificate.go\n\n\n\n3. The discovery Certificatefunction determines c.Request.TLS.HandshakeCompletewhether certificate communication has been performed\n\n\n\n4. Since c.Request.TLS.HandshakeCompletethe true or false judgment is determined by agent/server/server.gothe code Startfunctiontls.RequireAnyClientCert\n\n\n\nNote:\uff1a`Here due to the use of tls.RequireAnyClientCert instead of tls.RequireAndVerifyClientCert\uff0cRequireAnyClientCert Only require the client to provide a certificate\uff0cDoes not verify the issuance of certificates CA\uff0cSo any self assigned certificate will pass TLS handshake\u3002`\n\n5. The subsequent Certificatefunction only verified that the CN field of the certificate was panel_client, without verifying the certificate issuer. Finally, it was discovered that the WebSocket connection could bypass Proxy-ID verification.\n\n\n\n6. Process WebSocket interface (based on the above questions, all processes and other sensitive information can be obtained)\nrouting address: /process/ws\nthe request format is as follows\n```\n{\n \"type\": \"ps\", // \u6570\u636e\u7c7b\u578b: ps(\u8fdb\u7a0b), ssh(SSH\u4f1a\u8bdd), net(\u7f51\u7edc\u8fde\u63a5), wget(\u4e0b\u8f7d\u8fdb\u5ea6)\n \"pid\": 123, // \u53ef\u9009\uff0c\u6307\u5b9a\u8fdb\u7a0bID\u8fdb\u884c\u7b5b\u9009\n \"name\": \"process_name\", // \u53ef\u9009\uff0c\u6839\u636e\u8fdb\u7a0b\u540d\u7b5b\u9009\n \"username\": \"user\" // \u53ef\u9009\uff0c\u6839\u636e\u7528\u6237\u540d\u7b5b\u9009\n}\n```\n\n\n - Terminal SSH WebSocket interface (according to the above problem, any command can be executed)\nrouting address: /hosts/terminal\nthe request format is as follows\n```\n{\n \"type\": \"cmd\",\n \"data\": \"d2hvYW1pCg==\" // \"whoami\" \u7684base64\u7f16\u7801\uff0c\u8bb0\u4f4f\u4e0d\u8981\u5fd8\u8bb0\u56de\u8f66\u3002\n}\n```\n\n\n - Container Terminal WebSocket interface (container execution command interface)\nrouting address:/containers/terminal\n \n - File Download Process WebSocket interface (automatically push download progress information)\nrouting address:/files/wget/process\n\n### Attack process\n\n1. First generate a fake certificate\nopenssl req -x509 -newkey rsa:2048 -keyout panel_client.key -out panel_client.crt -days 365 -nodes -subj \"/CN=panel_client\"\n\n2. Then use the certificate to request verification. If the websocket interface is successfully connected, there is a vulnerability.\n\n\n\n", "id": "GHSA-8j63-96wh-wh3j", "modified": "2025-08-26T20:26:49Z", "published": "2025-08-01T18:10:21Z", "references": [ { "type": "WEB", "url": "https://github.com/1Panel-dev/1Panel/security/advisories/GHSA-8j63-96wh-wh3j" }, { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-54424" }, { "type": "WEB", "url": "https://github.com/1Panel-dev/1Panel/pull/9698/commits/4003284521f8d31ddaf7215d1c30ab8b4cdb0261" }, { "type": "PACKAGE", "url": "https://github.com/1Panel-dev/1Panel" }, { "type": "WEB", "url": "https://github.com/1Panel-dev/1Panel/releases/tag/v2.0.6" }, { "type": "WEB", "url": "https://pkg.go.dev/vuln/GO-2025-3834" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H", "type": "CVSS_V3" } ], "summary": "1Panel agent certificate verification bypass leading to arbitrary command execution" }
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.