CVE-2021-43836: Sulu/sulu PHP File Inclusion Vulnerability

HIGH
Advisory Identifier: GHSA-vx6j-pjrh-vgjh
CVSS 8.5
CWE-22
Published
Advisory Summary

CVE-2021-43836 is a HIGH (CVSS 8.5) php file inclusion vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Sulu/sulu libraries in the Packagist ecosystem. The issue involves php file inclusion in the sulu admin panel. Remediation is available by upgrading affected packages to version 1.6.44, 2.2.18, 2.3.8, 2.4.0.

CVE-2021-43836 at a Glance

CVE Identifier CVE-2021-43836
GHSA Identifier GHSA-vx6j-pjrh-vgjh
Severity HIGH
CVSS v3.1 Base Score 8.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Sulu/sulu
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.5

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

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

How to Fix CVE-2021-43836

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

sulu/sulu fixed: 1.6.44
Upgrade sulu/sulu to 1.6.44
sulu/sulu fixed: 2.2.18
Upgrade sulu/sulu to 2.2.18
sulu/sulu fixed: 2.3.8
Upgrade sulu/sulu to 2.3.8
sulu/sulu fixed: 2.4.0
Upgrade sulu/sulu to 2.4.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 sulu/sulu

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-43836, inspect your project dependencies for Sulu/sulu:

inspect dependencies for sulu/sulu

Analyze the terminal output to locate any version of Sulu/sulu in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.44), 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 Sulu/sulu, 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 _What kind of vulnerability is it? Who is impacted?_ An attacker can read arbitrary local files via a PHP file include. In a default configuration this also leads to remote code execution. * Compromised components: Arbitrary file read on the server, (Potential) Remote code execution * Exploitation pre-requisite: User account on the backend ### Patches _Has the problem been patched? What versions should users upgrade to?_ The problem is patched with the Versions 1.6.44, 2.2.18, 2.3.8, 2.4.0 ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ Overwrite the service `sulu_route.generator.expression_token_provider` and wrap the translator before passing it to the expression language. ### References _Are there any links users can visit to find out more?_ Currently not. ### For more information If you have any questions or comments about this advisory: * Open an issue in [example link to repo](http://example.com) * Email us at [example email address](mailto:example@example.com)

CVE-2021-43836 Affected Sulu/sulu Versions

4 component(s)
Fixed Versions:
1.6.442.2.182.3.82.4.0
Product / Package Ecosystem Affected Versions Fixed Version
sulu/sulu
Packagist
< 1.6.44
1.6.44
sulu/sulu
Packagist
≥ 2.0.0
< 2.2.18
2.2.18
sulu/sulu
Packagist
≥ 2.3.0
< 2.3.8
2.3.8
sulu/sulu
Packagist
≥ 2.4.0-RC1
< 2.4.0
All 1 versions
2.4.0-RC1
2.4.0

References

Frequently Asked Questions

What is CVE-2021-43836?
CVE-2021-43836 is a security vulnerability in Sulu/sulu involving PHP file inclusion in the Sulu admin panel under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Sulu/sulu versions are affected?
Affected versions include releases prior to 1.6.44, 2.2.18, 2.3.8, 2.4.0 across affected packages: sulu/sulu.
What version fixes CVE-2021-43836?
Upgrading to 1.6.44, 2.2.18, 2.3.8, 2.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sulu/sulu affected?
Yes, sulu/sulu is affected in releases prior to 1.6.44, 2.2.18, 2.3.8, 2.4.0. Upgrade your dependency to 1.6.44, 2.2.18, 2.3.8, 2.4.0 or later.
What is the CVSS score of CVE-2021-43836?
CVE-2021-43836 has a CVSS v3.1 base score of 8.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2021-43836?
CVE-2021-43836 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-2021-43836?
Run the dependency tree command: 'inspect dependencies for sulu/sulu'. 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-vx6j-pjrh-vgjh",
  "modified" : "2021-12-15T22:27:31Z",
  "published" : "2021-12-15T22:54:20Z",
  "aliases" : [ "CVE-2021-43836" ],
  "summary" : "PHP file inclusion in the Sulu admin panel",
  "details" : "### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nAn attacker can read arbitrary local files via a PHP file include. In a default configuration this also leads to remote code execution.\n\n* Compromised components: Arbitrary file read on the server, (Potential) Remote code execution\n* Exploitation pre-requisite: User account on the backend\n\n### Patches\n\n_Has the problem been patched? What versions should users upgrade to?_\n\nThe problem is patched with the Versions 1.6.44, 2.2.18, 2.3.8, 2.4.0\n\n### Workarounds\n\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nOverwrite the service `sulu_route.generator.expression_token_provider` and wrap the translator before passing it to the expression language. \n\n### References\n\n_Are there any links users can visit to find out more?_\n\nCurrently not.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [example link to repo](http://example.com)\n* Email us at [example email address](mailto:example@example.com)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sulu/sulu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.44"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sulu/sulu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.2.18"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sulu/sulu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0"
      }, {
        "fixed" : "2.3.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sulu/sulu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.4.0-RC1"
      }, {
        "fixed" : "2.4.0"
      } ]
    } ],
    "versions" : [ "2.4.0-RC1" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sulu/sulu/security/advisories/GHSA-vx6j-pjrh-vgjh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43836"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sulu/sulu/commit/9c948f9ce350c68b53af8c3910e2cefc7f722b54"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sulu/sulu"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-12-15T22:27:31Z",
    "nvd_published_at" : "2021-12-15T20:15:00Z"
  }
}