Summary
ZendFramework SQL injection due to execution of platform-specific SQL containing interpolations
The Zend\Db component in Zend Framework 2 provides platform abstraction, which is used in particular for SQL abstraction. Two methods defined in the platform interface, quoteValue() and quoteValueList(), allow users to manually quote values for creating SQL statements; these are in turn consumed by aspects of the SQL abstraction platform, including Zend\Db\Sql\Sql::getSqlStringForSqlObject(), and the getSqlString() method provided in a number of classes in the Zend\Db\Sql namespace.
While these methods are primarily intended for debugging and logging purposes, developers can use them to produce SQL that is then passed to the driver to execute. Due to a flaw in how the quoteValue() and quoteValueList() methods were written, this can lead to potential SQL injection.
The offending code is located in any of the Zend\Db\Adapter\Platform* objects, particularly the quoteValue() and quoteValueList() methods. These methods did not take into account most of the possible escapable characters that would need to be escaped when attempting to create a quoted value for interpolation into a SQL string. Moreover, these methods did value quoting without extension level coordination which, when available, takes character-sets into account when quoting.
Impact
Untrusted input alters a database query, allowing the attacker to read or modify data the query was not intended to access. Typical impact: data disclosure or modification.
GHSA-X2F4-8WXF-W3VF has a CVSS score of 8.8 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.0.8, 2.1.4); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
zendframework/zendframework to 2.0.8 or later; zendframework/zendframework to 2.1.4 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is GHSA-X2F4-8WXF-W3VF? GHSA-X2F4-8WXF-W3VF is a high-severity SQL injection vulnerability in zendframework/zendframework (composer), affecting versions >= 2.0.0, < 2.0.8. It is fixed in 2.0.8, 2.1.4. Untrusted input alters a database query, allowing the attacker to read or modify data the query was not intended to access.
- How severe is GHSA-X2F4-8WXF-W3VF? GHSA-X2F4-8WXF-W3VF has a CVSS score of 8.8 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of zendframework/zendframework are affected by GHSA-X2F4-8WXF-W3VF? zendframework/zendframework (composer) versions >= 2.0.0, < 2.0.8 is affected.
- Is there a fix for GHSA-X2F4-8WXF-W3VF? Yes. GHSA-X2F4-8WXF-W3VF is fixed in 2.0.8, 2.1.4. Upgrade to this version or later.
- Is GHSA-X2F4-8WXF-W3VF exploitable, and should I be worried? Whether GHSA-X2F4-8WXF-W3VF is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-X2F4-8WXF-W3VF is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-X2F4-8WXF-W3VF?
- Upgrade
zendframework/zendframeworkto 2.0.8 or later - Upgrade
zendframework/zendframeworkto 2.1.4 or later
- Upgrade