CVE-2023-4195: Cockpit hq/cockpit Cockpit PHP Remote File Inclusion Vulnerability

CRITICAL
Advisory Identifier: GHSA-xcq3-7pf3-5jvc
CVSS 9.9
CWE-98
Published
Advisory Summary

CVE-2023-4195 is a CRITICAL (CVSS 9.9) cockpit php remote file inclusion vulnerability (CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')) affecting Cockpit hq/cockpit libraries in the Packagist ecosystem. The issue involves cockpit php remote file inclusion vulnerability. Remediation is available by upgrading affected packages to version 2.6.3.

CVE-2023-4195 at a Glance

CVE Identifier CVE-2023-4195
GHSA Identifier GHSA-xcq3-7pf3-5jvc
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')
Affected Product Cockpit hq/cockpit
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 9.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:L/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 Changed (S:C)
Confidentiality Low (C:L)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-4195

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

cockpit-hq/cockpit fixed: 2.6.3
Upgrade cockpit-hq/cockpit to 2.6.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 cockpit-hq/cockpit

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-4195, inspect your project dependencies for Cockpit hq/cockpit:

inspect dependencies for cockpit-hq/cockpit

Analyze the terminal output to locate any version of Cockpit hq/cockpit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6.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-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion'), where the php application receives input from an upstream component, but it does not restrict or incorrectly restricts the input before its usage in "require," "include," or similar functions. In Cockpit hq/cockpit, 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

PHP Remote File Inclusion in GitHub repository cockpit-hq/cockpit prior to 2.6.3. Users may upload php files through the system file upload utility to obtain remote code execution.

CVE-2023-4195 Affected Cockpit hq/cockpit Versions

1 component(s)
Fixed Versions:
2.6.3
Product / Package Ecosystem Affected Versions Fixed Version
cockpit-hq/cockpit
Packagist
< 2.6.3
2.6.3

References

Frequently Asked Questions

What is CVE-2023-4195?
CVE-2023-4195 is a security vulnerability in Cockpit hq/cockpit involving Cockpit PHP Remote File Inclusion vulnerability under CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion').
Which Cockpit hq/cockpit versions are affected?
Affected versions include releases prior to 2.6.3 across affected packages: cockpit-hq/cockpit.
What version fixes CVE-2023-4195?
Upgrading to 2.6.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cockpit-hq/cockpit affected?
Yes, cockpit-hq/cockpit is affected in releases prior to 2.6.3. Upgrade your dependency to 2.6.3 or later.
What is the CVSS score of CVE-2023-4195?
CVE-2023-4195 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H.
What CWE is associated with CVE-2023-4195?
CVE-2023-4195 is classified under CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') (The PHP application receives input from an upstream component, but it does not restrict or incorrectly restricts the input before its usage in "require," "include," or similar functions.).
How can I check Packagist dependencies for CVE-2023-4195?
Run the dependency tree command: 'inspect dependencies for cockpit-hq/cockpit'. 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-xcq3-7pf3-5jvc",
  "modified" : "2023-08-09T14:32:48Z",
  "published" : "2023-08-06T18:30:25Z",
  "aliases" : [ "CVE-2023-4195" ],
  "summary" : "Cockpit PHP Remote File Inclusion vulnerability",
  "details" : "PHP Remote File Inclusion in GitHub repository cockpit-hq/cockpit prior to 2.6.3. Users may upload php files through the system file upload utility to obtain remote code execution.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cockpit-hq/cockpit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.6.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-4195"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cockpit-hq/cockpit/commit/800c05f1984db291769ffa5fdfb1d3e50968e95b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cockpit-hq/cockpit"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/0bd5da2f-0e29-47ce-90f3-06518656bfd6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-98" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-09T14:32:48Z",
    "nvd_published_at" : "2023-08-06T18:15:10Z"
  }
}