CVE-2022-0323: Mustache/mustache Mustache Remote Code Injection Vulnerability Vulnerability
HIGHCVE-2022-0323 is a HIGH (CVSS 8.8) mustache remote code injection vulnerability vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Mustache/mustache libraries in the Packagist ecosystem. The issue involves mustache remote code injection vulnerability. Remediation is available by upgrading affected packages to version 2.14.1.
CVE-2022-0323 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-2022-0323
To remediate this vulnerability, upgrade all affected Mustache/mustache 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 mustache/mustache to 2.14.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for mustache/mustache
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-0323, inspect your project dependencies for Mustache/mustache:
inspect dependencies for mustache/mustache
Analyze the terminal output to locate any version of Mustache/mustache in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.14.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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Mustache/mustache, 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-2022-0323 Affected Mustache/mustache Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mustache/mustache
|
Packagist |
≥ 2.0.0
< 2.14.1
|
2.14.1
|
References
Frequently Asked Questions
What is CVE-2022-0323?
Which Mustache/mustache versions are affected?
What version fixes CVE-2022-0323?
Is mustache/mustache affected?
What is the CVSS score of CVE-2022-0323?
What CWE is associated with CVE-2022-0323?
How can I check Packagist dependencies for CVE-2022-0323?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4rmr-c2jx-vx27",
"modified" : "2022-08-11T17:05:16Z",
"published" : "2022-01-27T14:51:00Z",
"aliases" : [ "CVE-2022-0323" ],
"summary" : "Mustache remote code injection vulnerability",
"details" : "In Mustache.php v2.0.0 through v2.14.0, Sections tag can lead to arbitrary php code execution even if strict_callables is true when section value is controllable.\n\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" : "mustache/mustache"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.14.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0323"
}, {
"type" : "WEB",
"url" : "https://github.com/bobthecow/mustache.php/commit/579ffa5c96e1d292c060b3dd62811ff01ad8c24e"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/mustache/mustache/CVE-2022-0323.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/bobthecow/mustache.php"
}, {
"type" : "WEB",
"url" : "https://github.com/bobthecow/mustache.php/releases/tag/v2.14.1"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/a5f5a988-aa52-4443-839d-299a63f44fb7"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1336", "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-24T23:01:39Z",
"nvd_published_at" : "2022-01-21T18:15:00Z"
}
}