CVE-2023-37473: Zenstruck/collection :find() And Query() Vulnerability
HIGHCVE-2023-37473 is a HIGH (CVSS 8.5) :find() and query() vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Zenstruck/collection libraries in the Packagist ecosystem. The issue involves :find() and query(). Remediation is available by upgrading affected packages to version 0.2.1.
CVE-2023-37473 at a Glance
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).
How to Fix CVE-2023-37473
To remediate this vulnerability, upgrade all affected Zenstruck/collection 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 zenstruck/collection to 0.2.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for zenstruck/collection
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-37473, inspect your project dependencies for Zenstruck/collection:
inspect dependencies for zenstruck/collection
Analyze the terminal output to locate any version of Zenstruck/collection in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Zenstruck/collection, 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-2023-37473 Affected Zenstruck/collection Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
zenstruck/collection
|
Packagist |
< 0.2.1
|
0.2.1
|
References
Frequently Asked Questions
What is CVE-2023-37473?
Which Zenstruck/collection versions are affected?
What version fixes CVE-2023-37473?
Is zenstruck/collection affected?
What is the CVSS score of CVE-2023-37473?
What CWE is associated with CVE-2023-37473?
How can I check Packagist dependencies for CVE-2023-37473?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7xr2-8ff7-6fjq",
"modified" : "2023-07-14T21:59:13Z",
"published" : "2023-07-14T21:59:13Z",
"aliases" : [ "CVE-2023-37473" ],
"summary" : "zenstruck/collection passing callable string to EntityRepository::find() and query()",
"details" : "### Impact\nPassing _callable strings_ (ie `system`) caused the function to be executed.\n\n### Patches\nFixed in [v0.2.1](https://github.com/zenstruck/collection/releases/tag/v0.2.1).\n\n### Workarounds\nDo not allow passing user strings to `EntityRepository::find()` or `query()`.\n\n### References\n[Fix commit](https://github.com/zenstruck/collection/commit/f4b1c488206e1b1581b06fcd331686846f13f19c).\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" : "zenstruck/collection"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.2.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/zenstruck/collection/security/advisories/GHSA-7xr2-8ff7-6fjq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-37473"
}, {
"type" : "WEB",
"url" : "https://github.com/zenstruck/collection/commit/f4b1c488206e1b1581b06fcd331686846f13f19c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/zenstruck/collection"
}, {
"type" : "WEB",
"url" : "https://github.com/zenstruck/collection/releases/tag/v0.2.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-07-14T21:59:13Z",
"nvd_published_at" : "2023-07-14T21:15:09Z"
}
}