Summary
Vendure's Shop API, and to a lesser extent the Admin API, contain a SQL injection vulnerability where a user-controlled query string parameter is interpolated directly into a raw SQL fragment.
An attacker can craft malicious input to execute arbitrary SQL against the underlying database on all supported backends, potentially leading to data exfiltration, modification, or service disruption.
Affected context
The vulnerability appears in Vendure deployments that:
- Run versions starting from 1.7.4 up to (but not including) the patched lines 2.3.4, 3.5.7, and 3.6.2, and
- Expose the Shop API (which is typically publicly accessible), and optionally the Admin API, and
- Use code paths where the
languageCode(or similar) query string parameter influences dynamically constructed SQL.
In this context, untrusted HTTP query parameters are interpolated directly into raw SQL expressions without parameterization or robust validation. All supported database engines (PostgreSQL, MySQL/MariaDB, SQLite) are affected, though actual impact depends on database privileges and schema design.
Exploit preconditions
- Attack surface: HTTP endpoints of the Shop API; Admin API endpoints are also affected but usually behind authentication.
- Required access:
- Shop API: Unauthenticated network access to the API endpoint is sufficient.
- Admin API: Valid authenticated user session, with access to affected operations.
- Trigger point: Supplying crafted values in the vulnerable query string parameter (e.g.,
languageCode) so that it is interpolated into a raw SQL snippet. - Why exploitation is possible: The application concatenates user input directly into SQL without parameterization or strict validation, allowing an attacker to alter the structure of the executed query rather than just its data values.
Why this happens
This issue stems from constructing SQL statements using string interpolation that directly incorporates untrusted HTTP parameters. Instead of using prepared statements or query builder parameter binding, the implementation embeds user-supplied values (such as languageCode) directly into a raw SQL expression.
This pattern maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). The SQL interpreter cannot distinguish between intended literals and attacker-supplied control characters (quotes, operators, comments), enabling the input to change the query's logic, combine multiple statements where allowed, or access data beyond the original intent.
Potential impact
- Extraction of sensitive customer, order, product, or configuration data from the Vendure database
- Unauthorized modification of business data, including prices, orders, and account information
- Creation or escalation of user accounts or roles if the schema permits it
- Deletion or corruption of tables and records, leading to data loss or service downtime
- Abuse of database-specific features to pivot further into the hosting environment, depending on configuration and privileges
General mitigation guidance
Mitigation centers on eliminating direct string interpolation in SQL and reducing trust in user-controlled parameters:
- Replace raw string concatenation with parameterized queries or a query builder that supports bound parameters for all user-controlled values.
- Ensure that contextual fields like
languageCodeare validated at input boundaries against a strict allow-list of supported values (e.g., ISO language tags configured for the channel). - Prefer strongly typed abstractions (enums, IDs, reference objects) over free-form strings when passing user input into query layers.
- Apply least-privilege principles at the database level so that the application account only has the permissions strictly required for normal operation.
- Enforce centralized input validation for repeated parameters (like language or locale) and reuse that logic consistently across APIs.
How teams detect issues like this
Effective detection typically combines code-level analysis with runtime monitoring:
- Static analysis: Configure SAST tools or lints to flag direct string concatenation in SQL construction, especially where HTTP request parameters or query strings are involved.
- Code review: Treat any raw SQL usage as a high-risk area; reviewers should look for:
- Direct interpolation of request parameters or GraphQL/REST arguments into SQL.
- Bypassing ORM/query builder parameter binding features.
- Repeated patterns of manual query construction that do not enforce allow-lists.
- Runtime monitoring: Use database activity monitoring and application logs to detect anomalous queries (e.g., unexpected
UNION, comments, or tautological conditions commonly associated with injection attempts). - Security testing: Incorporate automated DAST or API security scanning to probe query parameters for SQL injection behavior in non-production environments.

