VYPR
Critical severityNVD Advisory· Published Sep 8, 2022· Updated Apr 23, 2025

cruddl vulnerable to AQL injection through flexSearch

CVE-2022-36084

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.

PackageAffected versionsPatched versions
cruddlnpm
>= 3.0.0, < 3.0.23.0.2
cruddlnpm
>= 1.1.0, < 2.7.02.7.0

Affected products

3
  • AEB-labs/cruddlllm-create2 versions
    >=1.1.0, <2.7.0 || >=3.0.0, <3.0.2+ 1 more
    • (no CPE)range: >=1.1.0, <2.7.0 || >=3.0.0, <3.0.2
    • (no CPE)range: >= 3.0.0, < 3.0.2
  • ghsa-coords
    Range: >= 3.0.0, < 3.0.2

Patches

1
13b9233733ed

Use regular aql framework for flex search expression tokenization

https://github.com/AEB-labs/cruddlJan MelcherSep 2, 2022via ghsa
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

News mentions

0

No linked articles in our index yet.