CVE-2021-39174: Cachethq/cachet Cachet Configuration Leak Vulnerability

HIGH
Advisory Identifier: GHSA-88f9-7xxh-c688
CVSS 8.8
CWE-75
Published
Advisory Summary

CVE-2021-39174 is a HIGH (CVSS 8.8) cachet configuration leak vulnerability (CWE-75: Failure to Sanitize Special Elements into a Different Plane (Special Element Injection)) affecting Cachethq/cachet libraries in the Packagist ecosystem. The issue involves cachet configuration leak. Remediation is available by upgrading affected packages to version 2.5.1.

CVE-2021-39174 at a Glance

CVE Identifier CVE-2021-39174
GHSA Identifier GHSA-88f9-7xxh-c688
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-75: Failure to Sanitize Special Elements into a Different Plane (Special Element Injection)
Affected Product Cachethq/cachet
Package Ecosystem Packagist
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-2021-39174

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

cachethq/cachet fixed: 2.5.1
Upgrade cachethq/cachet to 2.5.1
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 cachethq/cachet

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-39174, inspect your project dependencies for Cachethq/cachet:

inspect dependencies for cachethq/cachet

Analyze the terminal output to locate any version of Cachethq/cachet in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.5.1), 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-75: Failure to Sanitize Special Elements into a Different Plane (Special Element Injection), where the product does not adequately filter user-controlled input for special elements with control implications. In Cachethq/cachet, 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 Authenticated users, regardless of their privileges (_User_ or _Admin_), can leak the value of any configuration entry of the dotenv file, e.g. the application secret (`APP_KEY`) and various passwords (email, database, etc). ### Patches This issue was addressed by improving `UpdateConfigCommandHandler` and preventing the use of nested variables in the resulting dotenv configuration file. ### Workarounds Only allow trusted source IP addresses to access to the administration dashboard. ### References Further technical details are available at [https://blog.sonarsource.com/cachet-code-execution-via-laravel-configuration-injection](https://blog.sonarsource.com/cachet-code-execution-via-laravel-configuration-injection). ### For more information If you have any questions or comments about this advisory, you can contact: - The original reporters, by sending an email to vulnerability.research [at] sonarsource.com; - The maintainers, by opening an issue on this repository.

CVE-2021-39174 Affected Cachethq/cachet Versions

1 component(s)
Fixed Versions:
2.5.1
Product / Package Ecosystem Affected Versions Fixed Version
cachethq/cachet
Packagist
< 2.5.1
2.5.1

References

Frequently Asked Questions

What is CVE-2021-39174?
CVE-2021-39174 is a security vulnerability in Cachethq/cachet involving Cachet configuration leak under CWE-75: Failure to Sanitize Special Elements into a Different Plane (Special Element Injection).
Which Cachethq/cachet versions are affected?
Affected versions include releases prior to 2.5.1 across affected packages: cachethq/cachet.
What version fixes CVE-2021-39174?
Upgrading to 2.5.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cachethq/cachet affected?
Yes, cachethq/cachet is affected in releases prior to 2.5.1. Upgrade your dependency to 2.5.1 or later.
What is the CVSS score of CVE-2021-39174?
CVE-2021-39174 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-2021-39174?
CVE-2021-39174 is classified under CWE-75: Failure to Sanitize Special Elements into a Different Plane (Special Element Injection) (The product does not adequately filter user-controlled input for special elements with control implications.).
How can I check Packagist dependencies for CVE-2021-39174?
Run the dependency tree command: 'inspect dependencies for cachethq/cachet'. 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-88f9-7xxh-c688",
  "modified" : "2022-08-16T18:38:53Z",
  "published" : "2021-08-30T16:11:43Z",
  "aliases" : [ "CVE-2021-39174" ],
  "summary" : "Cachet configuration leak",
  "details" : "### Impact\n\nAuthenticated users, regardless of their privileges (_User_ or _Admin_), can leak the value of any configuration entry of the dotenv file, e.g. the application secret (`APP_KEY`) and various passwords (email, database, etc). \n\n### Patches\n\nThis issue was addressed by improving `UpdateConfigCommandHandler` and preventing the use of nested variables in the resulting dotenv configuration file.\n\n### Workarounds\n\nOnly allow trusted source IP addresses to access to the administration dashboard.\n\n### References\n\nFurther technical details are available at [https://blog.sonarsource.com/cachet-code-execution-via-laravel-configuration-injection](https://blog.sonarsource.com/cachet-code-execution-via-laravel-configuration-injection).\n\n### For more information\n\nIf you have any questions or comments about this advisory, you can contact:\n- The original reporters, by sending an email to vulnerability.research [at] sonarsource.com;\n- The maintainers, by opening an issue on this repository.\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" : "Packagist",
      "name" : "cachethq/cachet"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.5.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.5.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/fiveai/Cachet/security/advisories/GHSA-88f9-7xxh-c688"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-39174"
  }, {
    "type" : "WEB",
    "url" : "https://blog.sonarsource.com/cachet-code-execution-via-laravel-configuration-injection"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cachethq/Cachet"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fiveai/Cachet/releases/tag/v2.5.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-75" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-08-27T23:34:07Z",
    "nvd_published_at" : "2021-08-28T00:15:00Z"
  }
}