Gremlin Security
ArcadeDB provides two Gremlin execution engines with different security profiles.
|
CRITICAL SECURITY NOTICE: The Groovy Gremlin engine is NOT SECURE and should NOT be used in production environments or with untrusted users. Despite security restrictions, it remains vulnerable to remote code execution (RCE) attacks. Always use the Java engine (default) for production deployments. |
Execution Engines
Java Engine (Default - Secure)
The native Java engine parses Gremlin queries using a restricted grammar and generates bytecode. This engine:
-
Only accepts valid Gremlin traversal syntax
-
Cannot execute arbitrary Java code
-
Blocks
Runtime.getRuntime().exec()and similar attacks -
Recommended for ALL deployments
-
Required for production and security-critical environments
Groovy Engine (Legacy - INSECURE)
|
SECURITY VULNERABILITY: The Groovy engine is vulnerable to Remote Code Execution (RCE) attacks. Authenticated users can execute arbitrary operating system commands. DO NOT USE IN PRODUCTION. |
The Groovy engine provides dynamic scripting capabilities but has critical security limitations:
-
Supports Groovy-specific syntax and dynamic features
-
Cannot be adequately secured -
SecureASTCustomizerhas known bypasses -
Vulnerable to:
Runtime.exec(),ProcessBuilder, file system access, reflection -
Only use for development/testing in fully trusted environments
-
Will display a security warning at startup
Configuration
Set the engine via database configuration:
-- Secure (default)
ALTER DATABASE `arcadedb.gremlin.engine` 'java';
-- Legacy with security restrictions (use only if needed)
ALTER DATABASE `arcadedb.gremlin.engine` 'groovy';
-- Auto-detect (not recommended for production)
ALTER DATABASE `arcadedb.gremlin.engine` 'auto';
Or via JVM startup parameters:
# Set to Java engine (secure)
java -Darcadedb.gremlin.engine=java ...
# Set to Groovy engine (use only if needed)
java -Darcadedb.gremlin.engine=groovy ...
Security Best Practices
-
Use Java Engine: ALWAYS use
'java'engine in production - this is non-negotiable for security -
Never Use Groovy in Production: The Groovy engine is vulnerable to RCE and cannot be secured
-
Least Privilege: Grant Gremlin query permissions only to fully trusted administrators
-
Input Validation: Never accept Gremlin queries from untrusted sources
-
Audit Logging: Monitor all Gremlin query execution for suspicious patterns
-
Network Isolation: Run ArcadeDB in isolated network segments
-
Authentication Required: Always require authentication for Gremlin access
Security Limitations (Groovy Engine)
|
Despite attempts to restrict dangerous operations, the Groovy engine remains vulnerable to:
The |
Migration from Groovy to Java Engine
If you are currently using the Groovy engine and want to migrate to the more secure Java engine:
-
Test your queries: Run your existing Gremlin queries with the Java engine to verify compatibility
-
Update configuration: Change the
arcadedb.gremlin.enginesetting to'java' -
Refactor if needed: If you have Groovy-specific syntax, refactor to standard Gremlin traversal syntax
-
Verify results: Ensure query results are consistent between engines
Most standard Gremlin queries work identically on both engines. The Java engine is faster and more secure.
Security Considerations
|
CRITICAL: Remote Code Execution Vulnerability The Groovy engine has a CRITICAL SECURITY VULNERABILITY that allows Remote Code Execution (RCE):
Example of vulnerable code that executes successfully:
The Java engine (default) is NOT vulnerable to these attacks. |
|
Default Engine Change: As of ArcadeDB version 25.1.0, the default Gremlin engine has been changed from If you explicitly enable the Groovy engine ( |