CVE-2023-37477: Github.com/1Panel dev/1Panel 1Panel Command Injection Vulnerability Vulnerability

HIGH
Advisory Identifier: GHSA-p9xf-74xh-mhw5
CVSS 8.8
CWE-78
Published
Advisory Summary

CVE-2023-37477 is a HIGH (CVSS 8.8) 1panel command injection vulnerability vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Github.com/1Panel dev/1Panel libraries in the Go ecosystem. The issue involves 1panel command injection vulnerability in firewall ip functionality. Remediation is available by upgrading affected packages to version 1.4.3.

CVE-2023-37477 at a Glance

CVE Identifier CVE-2023-37477
GHSA Identifier GHSA-p9xf-74xh-mhw5
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Github.com/1Panel dev/1Panel
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-37477

To remediate this vulnerability, upgrade all affected Github.com/1Panel dev/1Panel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/1Panel-dev/1Panel fixed: 1.4.3
Upgrade github.com/1Panel-dev/1Panel to 1.4.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/1Panel-dev/1Panel

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-37477, inspect your project dependencies for Github.com/1Panel dev/1Panel:

inspect dependencies for github.com/1Panel-dev/1Panel

Analyze the terminal output to locate any version of Github.com/1Panel dev/1Panel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Github.com/1Panel dev/1Panel, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary An OS command injection vulnerability exists in 1Panel firewall functionality. A specially-crafted HTTP request can lead to arbitrary command execution. An attacker can make an authenticated HTTP request to trigger this vulnerability. ### Details 1Panel firewall functionality `/hosts/firewall/ip` endpoint read user input without validation, the attacker extends the default functionality of the application, which execute system commands. ### PoC the payload `; sleep 3 #` will lead server response in 3 seconds ![image](https://user-images.githubusercontent.com/4935500/252299676-bc4a8b92-e475-40ee-a92a-fec9fad7a6c3.png) the payload `; sleep 6 #` will lead server response in 6 seconds ![image](https://user-images.githubusercontent.com/4935500/252299871-766cc411-69e5-4c6c-b4ff-7774fa974ea0.png) ### Impact An attacker can execute arbitrary code on the target system, which can lead to a complete compromise of the system. ### Patches The vulnerability has been fixed in v1.4.3. ### Workarounds It is recommended to upgrade the version to v1.4.3. ### References If you have any questions or comments about this advisory: Open an issue in https://github.com/1Panel-dev/1Panel Email us at wanghe@fit2cloud.com

CVE-2023-37477 Affected Github.com/1Panel dev/1Panel Versions

1 component(s)
Fixed Versions:
1.4.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/1Panel-dev/1Panel
Go
< 1.4.3
1.4.3

References

Frequently Asked Questions

What is CVE-2023-37477?
CVE-2023-37477 is a security vulnerability in Github.com/1Panel dev/1Panel involving 1Panel command injection vulnerability in Firewall ip functionality under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Github.com/1Panel dev/1Panel versions are affected?
Affected versions include releases prior to 1.4.3 across affected packages: github.com/1Panel-dev/1Panel.
What version fixes CVE-2023-37477?
Upgrading to 1.4.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/1Panel-dev/1Panel affected?
Yes, github.com/1Panel-dev/1Panel is affected in releases prior to 1.4.3. Upgrade your dependency to 1.4.3 or later.
What is the CVSS score of CVE-2023-37477?
CVE-2023-37477 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-37477?
CVE-2023-37477 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check Go dependencies for CVE-2023-37477?
Run the dependency tree command: 'inspect dependencies for github.com/1Panel-dev/1Panel'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-p9xf-74xh-mhw5",
  "modified" : "2023-07-27T18:49:02Z",
  "published" : "2023-07-18T19:10:58Z",
  "aliases" : [ "CVE-2023-37477" ],
  "summary" : "1Panel command injection vulnerability in Firewall ip functionality",
  "details" : "### Summary\nAn OS command injection vulnerability exists in 1Panel firewall functionality. A specially-crafted HTTP request can lead to arbitrary command execution. An attacker can make an authenticated HTTP request to trigger this vulnerability.\n\n### Details\n1Panel firewall functionality `/hosts/firewall/ip` endpoint read user input without validation, the attacker extends the default functionality of the application, which execute system commands.\n\n### PoC\nthe payload `; sleep 3 #` will lead server response in 3 seconds \n![image](https://user-images.githubusercontent.com/4935500/252299676-bc4a8b92-e475-40ee-a92a-fec9fad7a6c3.png)\n\nthe payload `; sleep 6 #` will lead server response in 6 seconds \n![image](https://user-images.githubusercontent.com/4935500/252299871-766cc411-69e5-4c6c-b4ff-7774fa974ea0.png)\n\n### Impact\nAn attacker can execute arbitrary code on the target system, which can lead to a complete compromise of the system.\n\n### Patches\n\nThe vulnerability has been fixed in v1.4.3.\n\n### Workarounds\n\nIt is recommended to upgrade the version to v1.4.3.\n\n### References\n\nIf you have any questions or comments about this advisory:\n\nOpen an issue in https://github.com/1Panel-dev/1Panel\nEmail us at wanghe@fit2cloud.com\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/1Panel-dev/1Panel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.4.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/1Panel-dev/1Panel/security/advisories/GHSA-p9xf-74xh-mhw5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-37477"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/1Panel-dev/1Panel/commit/e17b80cff4975ee343568ff526b62319f499005d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/1Panel-dev/1Panel"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/1Panel-dev/1Panel/releases/tag/v1.4.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-18T19:10:58Z",
    "nvd_published_at" : "2023-07-18T19:15:09Z"
  }
}