CVE-2026-40887
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedVendure is an open-source headless commerce platform. Starting in version 1.7.4 and prior to versions 2.3.4, 3.5.7, and 3.6.2, an unauthenticated SQL injection vulnerability exists in the Vendure Shop API. A user-controlled query string parameter is interpolated directly into a raw SQL expression without parameterization or validation, allowing an attacker to execute arbitrary SQL against the database. This affects all supported database backends (PostgreSQL, MySQL/MariaDB, SQLite). The Admin API is also affected, though exploitation there requires authentication. Versions 2.3.4, 3.5.7, and 3.6.2 contain a patch. For those who are unable to upgrade immediately, Vendure has made a hotfix available that uses `RequestContextService.getLanguageCode` to validate the `languageCode` input at the boundary. This blocks injection payloads before they can reach any query. The hotfix replaces the existing `getLanguageCode` method in `packages/core/src/service/helpers/request-context/request-context.service.ts`. Invalid values are silently dropped and the channel's default language is used instead. The patched versions additionally convert the vulnerable SQL interpolation to a parameterized query as defense in depth.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceUnauthenticated SQL injection in Vendure Shop API allows arbitrary SQL execution via user-controlled query string parameter interpolated directly into raw SQL without parameterization. The vulnerability affects all supported database backends (PostgreSQL, MySQL/MariaDB, SQLite) and stems from the languageCode parameter being used in raw SQL expressions.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify Vendure installation and versionLocate the Vendure application directory and check package.json for the @vendure/core version, or query the running application's health/metadata endpoint if availableAffected if The installed version is below 2.3.4, below 3.5.7, or below 3.6.2 (specifically any 0.x, 1.x, 2.0.0-2.3.3, 3.0.0-3.5.6, or 3.6.0-3.6.1)
-
Verify Shop API is exposedInspect the vendure.config.ts file and look for the apiOptions.shopApi configuration; check if the Shop API endpoint is accessible over the network without authenticationAffected if The Shop API (shopApi: true or similar) is enabled and reachable without authentication on the server
-
Identify languageCode parameter usage in API routesSearch the codebase for usage of languageCode in GraphQL resolvers or REST endpoints, specifically looking for raw SQL queries or query builder calls that use this parameter; inspect files under src/plugins/ or similar resolver locationsAffected if The application code contains raw SQL queries or query builders that incorporate the languageCode query parameter without parameterized binding
-
Check database query loggingEnable and review database query logs (PostgreSQL log_statement, MySQL general_log, or SQLite debug flags) to look for suspicious SQL patterns involving languageCode values in WHERE clauses or similar constructsAffected if Unusual or malicious SQL patterns appear in logs with languageCode values that suggest injection attempts or direct string interpolation
-
Review API access patternsAnalyze HTTP access logs for requests to Shop API endpoints containing languageCode parameters with unusual characters (quotes, semicolons, UNION, SELECT keywords)Affected if Requests to Shop API endpoints show languageCode values containing SQL metacharacters or common injection patterns
You are affected if your Vendure installation version is below 2.3.4, 3.5.7, or 3.6.2 AND the Shop API is accessible without authentication AND your application uses the languageCode parameter in database queries.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedImmediately upgrade to patched versions 2.3.4, 3.5.7, or 3.6.2, or apply the hotfix that validates languageCode input via RequestContextService.getLanguageCode to block injection payloads before reaching queries.
Vendure 2.3.4, 3.5.7, or 3.6.2 (depending on your current major version line)
- Identify the currently installed Vendure version by checking package.json or the node_modules/vendure-core/package.json
- If running Vendure 1.x: upgrade to version 3.5.7 or 3.6.2 (these contain the security fix)
- If running Vendure 2.x: upgrade to version 2.3.4
- If running Vendure 3.x: upgrade to version 3.5.7 or 3.6.2
- Run `npm install` or `yarn install` to update dependencies
- Restart the Vendure server to apply the changes
- Verify the Shop API endpoint no longer accepts SQL injection payloads in the languageCode parameter
- If immediate upgrade is not possible, apply the hotfix by modifying `packages/core/src/service/helpers/request-context/request-context.service.ts` to validate languageCode input using RequestContextService.getLanguageCode before it reaches any query
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation3.0 h
- Implementation4.0 h
- Testing6.0 h
- Review / QA3.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,416.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2026-40887 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-40887 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data