Skip to content

1Panel agent certificate verification bypass leading to arbitrary command execution

High severity GitHub Reviewed Published Aug 1, 2025 in 1Panel-dev/1Panel • Updated Aug 4, 2025

Package

gomod github.com/1Panel-dev/1Panel/core (Go)

Affected versions

>= 1.0.0, < 2.0.6
< 0.0.0-20250730021757-04b9cbd87a15

Patched versions

2.0.6
0.0.0-20250730021757-04b9cbd87a15

Description

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

  1. First we go to the Agent HTTP routing fileagent/init/router/router.go

  1. It was found that the Routersreference function in the function Certificatewas globally checked.agent/middleware/certificate.go

  1. The discovery Certificatefunction determines c.Request.TLS.HandshakeCompletewhether certificate communication has been performed

  1. 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。

  1. 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.

  1. 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

  1. 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"

  2. Then use the certificate to request verification. If the websocket interface is successfully connected, there is a vulnerability.

References

@wanghe-fit2cloud wanghe-fit2cloud published to 1Panel-dev/1Panel Aug 1, 2025
Published to the GitHub Advisory Database Aug 1, 2025
Reviewed Aug 1, 2025
Published by the National Vulnerability Database Aug 1, 2025
Last updated Aug 4, 2025

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(30th percentile)

Weaknesses

Improper Neutralization of Special Elements used in a Command ('Command Injection')

The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. Learn more on MITRE.

Improper Certificate Validation

The product does not validate, or incorrectly validates, a certificate. Learn more on MITRE.

CVE ID

CVE-2025-54424

GHSA ID

GHSA-8j63-96wh-wh3j

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.