CVE-2023-27577: Flarum/core Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-vhm8-wwrf-3gcw
CVSS 6.5
CWE-22
Published
Advisory Summary

CVE-2023-27577 is a MODERATE (CVSS 6.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Flarum/core libraries in the Packagist ecosystem. The issue involves path traversal vulnerability in `less` parser allows reading of sensitive server files. Remediation is available by upgrading affected packages to version 1.7.0.

CVE-2023-27577 at a Glance

CVE Identifier CVE-2023-27577
GHSA Identifier GHSA-vhm8-wwrf-3gcw
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Flarum/core
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2023-27577

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

flarum/core fixed: 1.7.0
Upgrade flarum/core to 1.7.0
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 flarum/core

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-27577, inspect your project dependencies for Flarum/core:

inspect dependencies for flarum/core

Analyze the terminal output to locate any version of Flarum/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.0), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Flarum/core, 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

### Impact If an admin account has already been compromised by an attacker, the `LESS` parser can be exploited to read sensitive files on the server through the use of path traversal techniques. An attacker can achieve this by providing an absolute path to a sensitive file in the custom `LESS` setting, which the `LESS` parser will then read. For example, an attacker could use the following code to read the contents of the `/etc/passwd` file: ```less @import (inline) '/etc/passwd'; .test { content: data-uri('/etc/passwd'); } ``` ### Patches The vulnerability has been addressed in version `1.7`. Users should upgrade to this version to mitigate the vulnerability. ### Workarounds Users can mitigate the vulnerability by ensuring that their admin accounts are secured with strong passwords and other best practices for account security. Additionally, users can limit the exposure of sensitive files on the server by implementing appropriate file permissions and access controls.

CVE-2023-27577 Affected Flarum/core Versions

1 component(s)
Fixed Versions:
1.7.0
Product / Package Ecosystem Affected Versions Fixed Version
flarum/core
Packagist
< 1.7.0
1.7.0

References

Frequently Asked Questions

What is CVE-2023-27577?
CVE-2023-27577 is a security vulnerability in Flarum/core involving Path Traversal Vulnerability in `LESS` Parser allows reading of sensitive server files under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Flarum/core versions are affected?
Affected versions include releases prior to 1.7.0 across affected packages: flarum/core.
What version fixes CVE-2023-27577?
Upgrading to 1.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is flarum/core affected?
Yes, flarum/core is affected in releases prior to 1.7.0. Upgrade your dependency to 1.7.0 or later.
What is the CVSS score of CVE-2023-27577?
CVE-2023-27577 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H.
What CWE is associated with CVE-2023-27577?
CVE-2023-27577 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Packagist dependencies for CVE-2023-27577?
Run the dependency tree command: 'inspect dependencies for flarum/core'. 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-vhm8-wwrf-3gcw",
  "modified" : "2023-03-13T20:52:11Z",
  "published" : "2023-03-13T20:52:11Z",
  "aliases" : [ "CVE-2023-27577" ],
  "summary" : "Path Traversal Vulnerability in `LESS` Parser allows reading of sensitive server files",
  "details" : "### Impact\nIf an admin account has already been compromised by an attacker, the `LESS` parser can be exploited to read sensitive files on the server through the use of path traversal techniques.\n\nAn attacker can achieve this by providing an absolute path to a sensitive file in the custom `LESS` setting, which the `LESS` parser will then read. For example, an attacker could use the following code to read the contents of the `/etc/passwd` file:\n\n```less\n@import (inline) '/etc/passwd';\n\n.test {\n  content: data-uri('/etc/passwd');\n}\n```\n\n### Patches\nThe vulnerability has been addressed in version `1.7`. Users should upgrade to this version to mitigate the vulnerability.\n\n### Workarounds\nUsers can mitigate the vulnerability by ensuring that their admin accounts are secured with strong passwords and other best practices for account security. Additionally, users can limit the exposure of sensitive files on the server by implementing appropriate file permissions and access controls.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "flarum/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/flarum/framework/security/advisories/GHSA-vhm8-wwrf-3gcw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-27577"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flarum/framework/commit/1761660c98ea5a3e9665fb8e6041d1f2ee62a444"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/flarum/flarum-core"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flarum/flarum-core/releases/tag/v1.7.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-13T20:52:11Z",
    "nvd_published_at" : "2023-03-10T21:15:00Z"
  }
}