Summary
ArcadeDB contains a remote code execution vulnerability in its Gremlin query engine caused by an unsafe fallback from the secure gremlin-lang engine to Groovy. An authenticated user with any database role, including read-only access, may submit a parameterized query that triggers the fallback and execute operating system commands as the ArcadeDB server process.
Affected context
The vulnerability occurs in ArcadeDB deployments using the affected Gremlin query engine behavior. The documented-secure gremlin-lang engine is used by default, but requests containing query parameters may be routed to the Groovy engine when the query does not parse as gremlin-lang. The risk is present when an authenticated database user can submit Gremlin queries and the server process has meaningful operating system permissions.
Exploit preconditions
- Attack surface: Gremlin query endpoint or API exposed by the ArcadeDB server
- Required access: Authentication with any database role, including read-only access
- Trigger point: Processing a parameterized Gremlin request that is not accepted by the gremlin-lang parser
- Why exploitation is possible: Query handling silently selects an interpreter capable of evaluating code rather than rejecting the unsupported input
Why this happens
The underlying bug is an unsafe interpreter fallback in query processing. Instead of consistently rejecting input that fails secure-language parsing, the application routes certain parameterized requests to the Groovy engine, which can evaluate operations beyond the intended database query language. This behavior maps to CWE-94: Improper Control of Generation of Code, because attacker-influenced query content reaches a code-execution-capable interpreter.
Potential impact
- An attacker may execute arbitrary operating system commands as the ArcadeDB service account.
- The database process could be compromised or disrupted.
- Sensitive database records and server-side files could be accessed or modified.
- The attacker could use the server as a foothold for lateral movement, depending on network access and privileges.
- Data integrity could be affected through unauthorized changes or destruction.
General mitigation guidance
Mitigation generally focuses on ensuring that query input cannot reach an unintended code-execution-capable interpreter.
Common defensive patterns include:
- Removing insecure interpreter fallbacks and rejecting queries that fail the approved language parser.
- Allowing only an explicitly selected, restricted query engine through secure-by-default configuration.
- Treating query parameters and query text as untrusted input, regardless of the authenticated user's database role.
- Separating query-language parsing from code evaluation and applying strict grammar and schema validation.
- Running the database service with the minimum operating system and database privileges required.
- Restricting outbound network access and filesystem permissions for the database process.
- Applying authorization policies that limit query capabilities independently of read-only or read-write data permissions.
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying fallback paths from safe parsers to dynamic language interpreters.
- Code review checks for query engines that silently change language or execution mode after parse failures.
- Tests that verify malformed or unsupported queries are rejected rather than evaluated by another interpreter.
- Policy enforcement preventing production services from enabling general-purpose scripting engines for query execution.
- Runtime monitoring for unusual process creation, shell activity, filesystem access, or outbound connections by the ArcadeDB service account.
- Audit review of authenticated Gremlin requests, including parameterized queries and requests made by low-privilege roles.
- Automated security review tools that flag dynamic code evaluation and interpreter fallback patterns.

