CVE-2021-39173: Cachethq/cachet Remote Code Execution Vulnerability
HIGHCVE-2021-39173 is a HIGH (CVSS 8.8) remote code execution vulnerability (CWE-704: Incorrect Type Conversion or Cast) affecting Cachethq/cachet libraries in the Packagist ecosystem. The issue involves cachet vulnerable to forced reinstall. Remediation is available by upgrading affected packages to version 2.5.1.
CVE-2021-39173 at a Glance
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).
How to Fix CVE-2021-39173
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.
Upgrade cachethq/cachet to 2.5.1
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-39173, 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-704: Incorrect Type Conversion or Cast, where the product does not correctly convert an object, resource, or structure from one type to a different type. 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
CVE-2021-39173 Affected Cachethq/cachet Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
cachethq/cachet
|
Packagist |
< 2.5.1
|
2.5.1
|
References
Frequently Asked Questions
What is CVE-2021-39173?
Which Cachethq/cachet versions are affected?
What version fixes CVE-2021-39173?
Is cachethq/cachet affected?
What is the CVSS score of CVE-2021-39173?
What CWE is associated with CVE-2021-39173?
How can I check Packagist dependencies for CVE-2021-39173?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r67m-m8c7-jp83",
"modified" : "2022-08-16T18:40:56Z",
"published" : "2021-08-30T16:11:33Z",
"aliases" : [ "CVE-2021-39173" ],
"summary" : "Cachet vulnerable to forced reinstall",
"details" : "### Impact\n\nAuthenticated users, regardless of their privileges (_User_ or _Admin_), can trick Cachet and install the instance again, leading to arbitrary code execution on the server.\n\n### Patches\n\nThis issue was addressed by improving the middleware `ReadyForUse`, which now performs a stricter validation of the instance name. \n\n### Workarounds\n\nOnly allow trusted source IP addresses to access to the administration dashboard.\n\n### References\n\n- 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"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/fiveai/Cachet/security/advisories/GHSA-r67m-m8c7-jp83"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-39173"
}, {
"type" : "WEB",
"url" : "https://blog.sonarsource.com/cachet-code-execution-via-laravel-configuration-injection"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/fiveai/Cachet"
}, {
"type" : "WEB",
"url" : "https://github.com/fiveai/Cachet/releases/tag/v2.5.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-704" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-08-27T23:34:37Z",
"nvd_published_at" : "2021-08-27T23:15:00Z"
}
}