cruddl vulnerable to AQL injection through flexSearch
Description
cruddl is software for creating a GraphQL API for a database, using the GraphQL SDL to model a schema. If cruddl starting with version 1.1.0 and prior to versions 2.7.0 and 3.0.2 is used to generate a schema that uses @flexSearchFulltext, users of that schema may be able to inject arbitrary AQL queries that will be forwarded to and executed by ArangoDB. Schemas that do not use @flexSearchFulltext are not affected. The attacker needs to have READ permission to at least one root entity type that has @flexSearchFulltext enabled. The issue has been fixed in version 3.0.2 and in version 2.7.0 of cruddl. As a workaround, users can temporarily remove @flexSearchFulltext from their schemas.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
cruddl prior to versions 2.7.0 and 3.0.2 allows AQL injection via `@flexSearchFulltext` directive, enabling attackers with READ permission on root entities to execute arbitrary queries against ArangoDB.
Vulnerability
Overview CVE-2022-36084 is an AQL injection vulnerability in cruddl, a library for generating GraphQL APIs from a schema. The flaw affects versions from 1.1.0 up to (but excluding) 2.7.0 and 3.0.2 [1]. It arises when the schema uses the @flexSearchFulltext directive. The root cause is improper tokenization of user-controlled expressions passed to ArangoDB's TOKENS() function; the fix replaces string interpolation with parameterized AQL fragments to prevent injection [4].
Attack
Vector An attacker must have READ permission on at least one root entity type that has @flexSearchFulltext enabled [1]. With that access, they can craft malicious input that, when processed by the @flexSearchFulltext directive, injects arbitrary AQL statements. The injected queries are then executed by the underlying ArangoDB instance, bypassing the intended GraphQL query constraints [2]. Schemas that do not use @flexSearchFulltext are not affected.
Impact
Successful exploitation allows the attacker to execute arbitrary AQL queries against the ArangoDB database [1]. This could lead to unauthorized reading, modification, or deletion of data, depending on the database permissions. The impact is limited by the attacker's existing READ permission, but injected queries can potentially access or alter data beyond the boundaries of the original GraphQL request.
Mitigation
The vulnerability is fixed in cruddl versions 3.0.2 and 2.7.0 [1]. Users should upgrade immediately. As a temporary workaround, users can remove @flexSearchFulltext from their schemas until they can apply the patch [1]. No evidence of active exploitation in the wild was provided with the CVE.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
cruddlnpm | >= 3.0.0, < 3.0.2 | 3.0.2 |
cruddlnpm | >= 1.1.0, < 2.7.0 | 2.7.0 |
Affected products
3Patches
113b9233733edUse regular aql framework for flex search expression tokenization
2 files changed · +7 −6
src/database/arangodb/aql-generator.ts+4 −5 modified@@ -1762,12 +1762,11 @@ function isStringCaseInsensitive(str: string) { return str.toLowerCase() === str.toUpperCase(); } -export function generateTokenizationQuery(tokensFiltered: ReadonlyArray<FlexSearchTokenizable>) { - const fragments: string[] = []; +export function generateTokenizationQuery(tokensFiltered: ReadonlyArray<FlexSearchTokenizable>): AQLFragment { + const fragments: AQLFragment[] = []; for (let i = 0; i < tokensFiltered.length; i++) { const value = tokensFiltered[i]; - fragments.push(`token_${i}: TOKENS("${value.expression}", "${value.analyzer}")`); + fragments.push(aql`${aql.identifier('token_' + i)}: TOKENS(${value.expression}, ${value.analyzer})`); } - const query = `RETURN { ${fragments.join(',\n')} }`; - return query; + return aql`RETURN { ${aql.join(fragments, aql`',\n`)} }`; }
src/database/arangodb/arangodb-adapter.ts+3 −1 modified@@ -718,7 +718,9 @@ export class ArangoDBAdapter implements DatabaseAdapter { ) ); - const cursor = await this.db.query(generateTokenizationQuery(tokenizationsFiltered)); + const aqlFragment = generateTokenizationQuery(tokenizationsFiltered); + const queryCode = aqlFragment.getCode(); + const cursor = await this.db.query(queryCode.code, queryCode.boundValues); const result = await cursor.next(); const resultArray: FlexSearchTokenization[] = [];
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-qm4w-4995-vg7fghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-36084ghsaADVISORY
- github.com/AEB-labs/cruddl/commit/13b9233733ed6fc822718a07bc90a80cd3492698ghsax_refsource_MISCWEB
- github.com/AEB-labs/cruddl/pull/253ghsax_refsource_MISCWEB
- github.com/AEB-labs/cruddl/security/advisories/GHSA-qm4w-4995-vg7fghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.