CVE-2023-40033: Flarum/core Flarum Vulnerable To LFI And Vulnerability

HIGH
Advisory Identifier: GHSA-67c6-q4j4-hccg
CVSS 7.1
CWE-98 CWE-918
Published
Advisory Summary

CVE-2023-40033 is a HIGH (CVSS 7.1) flarum vulnerable to lfi and vulnerability (CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')) affecting Flarum/core libraries in the Packagist ecosystem. The issue involves flarum vulnerable to lfi and blind ssrf via avatar upload. Remediation is available by upgrading affected packages to version 1.8.0.

CVE-2023-40033 at a Glance

CVE Identifier CVE-2023-40033
GHSA Identifier GHSA-67c6-q4j4-hccg
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')
Affected Product Flarum/core
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.1

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:L/A:N).

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 Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-40033

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.8.0
Upgrade flarum/core to 1.8.0
flarum/framework fixed: 1.8.0
Upgrade flarum/framework to 1.8.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-40033, 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.8.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-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 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 The Flarum forum software is affected by a vulnerability that allows an attacker to conduct a Blind SSRF attack or disclose any file on the server, even with a basic user account on any Flarum forum. By uploading a file containing a URL and spoofing the MIME type, an attacker can manipulate the application to execute unintended actions. The vulnerability is due to the behavior of the `intervention/image` package, which attempts to interpret the supplied file contents as a URL, which then fetches its contents. This allows an attacker to exploit the vulnerability to perform SSRF attacks, disclose local file contents, or conduct a blind oracle attack. ### Patches This has been patched in Flarum **v1.8**. ## Workarounds As a temporary workaround for the SSRF aspect of the vulnerability, one can disable PHP's `allow_url_fopen` which will prevent the fetching of external files via URLs. ### Credits Adam Kues - [Assetnote](https://assetnote.io/)

CVE-2023-40033 Affected Flarum/core Versions

2 component(s)
Fixed Versions:
1.8.0
Product / Package Ecosystem Affected Versions Fixed Version
flarum/core
Packagist
< 1.8.0
1.8.0
flarum/framework
Packagist
< 1.8.0
1.8.0

References

Frequently Asked Questions

What is CVE-2023-40033?
CVE-2023-40033 is a security vulnerability in Flarum/core involving Flarum vulnerable to LFI and Blind SSRF via Avatar upload under CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion').
Which Flarum/core versions are affected?
Affected versions include releases prior to 1.8.0 across affected packages: flarum/core, flarum/framework.
What version fixes CVE-2023-40033?
Upgrading to 1.8.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.8.0. Upgrade your dependency to 1.8.0 or later.
Is flarum/framework affected?
Yes, flarum/framework is affected in releases prior to 1.8.0. Upgrade your dependency to 1.8.0 or later.
What is the CVSS score of CVE-2023-40033?
CVE-2023-40033 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2023-40033?
CVE-2023-40033 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-40033?
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-67c6-q4j4-hccg",
  "modified" : "2023-08-16T21:02:52Z",
  "published" : "2023-08-16T21:02:52Z",
  "aliases" : [ "CVE-2023-40033" ],
  "summary" : "Flarum vulnerable to LFI and Blind SSRF via Avatar upload",
  "details" : "## Impact\nThe Flarum forum software is affected by a vulnerability that allows an attacker to conduct a Blind SSRF attack or disclose any file on the server, even with a basic user account on any Flarum forum. By uploading a file containing a URL and spoofing the MIME type, an attacker can manipulate the application to execute unintended actions. The vulnerability is due to the behavior of the `intervention/image` package, which attempts to interpret the supplied file contents as a URL, which then fetches its contents. This allows an attacker to exploit the vulnerability to perform SSRF attacks, disclose local file contents, or conduct a blind oracle attack.\n\n### Patches\nThis has been patched in Flarum **v1.8**.\n\n## Workarounds\nAs a temporary workaround for the SSRF aspect of the vulnerability, one can disable PHP's `allow_url_fopen` which will prevent the fetching of external files via URLs.\n\n### Credits\nAdam Kues - [Assetnote](https://assetnote.io/)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "flarum/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.8.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "flarum/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.8.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/flarum/framework/security/advisories/GHSA-67c6-q4j4-hccg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-40033"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flarum/framework/commit/d1059c1cc79fe61f9538f3da55e8f42abbede570"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/flarum/framework"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918", "CWE-98" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-16T21:02:52Z",
    "nvd_published_at" : "2023-08-16T21:15:09Z"
  }
}