CVE-2021-43822: Jackalope/jackalope doctrine dbal SQL Injection Vulnerability
HIGHCVE-2021-43822 is a HIGH (CVSS 8.5) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Jackalope/jackalope doctrine dbal libraries in the Packagist ecosystem. The issue involves sql injection in jackalope/jackalope-doctrine-dbal. Remediation is available by upgrading affected packages to version 1.7.4.
CVE-2021-43822 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-2021-43822
To remediate this vulnerability, upgrade all affected Jackalope/jackalope doctrine dbal 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 jackalope/jackalope-doctrine-dbal to 1.7.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for jackalope/jackalope-doctrine-dbal
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-43822, inspect your project dependencies for Jackalope/jackalope doctrine dbal:
inspect dependencies for jackalope/jackalope-doctrine-dbal
Analyze the terminal output to locate any version of Jackalope/jackalope doctrine dbal in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.4), 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-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Jackalope/jackalope doctrine dbal, 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-43822 Affected Jackalope/jackalope doctrine dbal Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
jackalope/jackalope-doctrine-dbal
|
Packagist |
< 1.7.4
|
1.7.4
|
References
Frequently Asked Questions
What is CVE-2021-43822?
Which Jackalope/jackalope doctrine dbal versions are affected?
What version fixes CVE-2021-43822?
Is jackalope/jackalope-doctrine-dbal affected?
What is the CVSS score of CVE-2021-43822?
What CWE is associated with CVE-2021-43822?
How can I check Packagist dependencies for CVE-2021-43822?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-ph98-v78f-jqrm",
"modified" : "2021-12-14T15:25:41Z",
"published" : "2021-12-14T21:08:13Z",
"aliases" : [ "CVE-2021-43822" ],
"summary" : "SQL injection in jackalope/jackalope-doctrine-dbal",
"details" : "### Impact\n\nUsers can provoke SQL injections if they can specify a node name or query.\n\n### Patches\n\nUpgrade to version 1.7.4\n\nIf that is not possible, you can escape all places where `$property` is used to filter `sv:name` in the class `Jackalope\\Transport\\DoctrineDBAL\\Query\\QOMWalker`: `XPath::escape($property)`.\n\n### Workarounds\n\nNode names and xpaths can contain `\"` or `;` according to the JCR specification. The jackalope component that translates the query object model into doctrine dbal queries does not properly escape the names and paths, so that a accordingly crafted node name can lead to an SQL injection.\n\nIf queries are never done from user input, or if you validate the user input to not contain `;`, you are not affected. \n\n### References\n\nNo further references.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [jackalope/jackalope-doctrine-dbal repo](https://github.com/jackalope/jackalope-doctrine-dbal/issues)\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" : "jackalope/jackalope-doctrine-dbal"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.7.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jackalope/jackalope-doctrine-dbal/security/advisories/GHSA-ph98-v78f-jqrm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43822"
}, {
"type" : "WEB",
"url" : "https://github.com/jackalope/jackalope-doctrine-dbal/commit/9d179a36d320330ddb303ea3a7c98d3a33d231db"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jackalope/jackalope-doctrine-dbal"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-12-14T15:25:41Z",
"nvd_published_at" : "2021-12-13T20:15:00Z"
}
}