GHSA-R946-225C-5X88
Analysing a Gremlin script on the auto engine writes through the Graph API and then reports the script as a read, so the MCP read-only query tool commits the write it was about to refuse
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-R946-225C-5X88 divulgada | |
| Remediación | Parche 26.11.1 | com.arcadedb:arcadedb-gremlin · 2 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
SEVERITY: MEDIUM (bounded to a bound server administrator, measured)
Summary
QueryEngine.analysisEvaluatesQuery() is the contract that lets a caller use analyze() as a check
that runs before the text does anything. GremlinQueryEngine does not override it, although its
analysis evaluates Groovy on the fallback arm. Measured consequence, worse than the lead claimed:
analyze() of a script whose leading statement writes through the Graph API not only performs the
write and makes it durable, it then classifies the script as idempotent with operation types
[READ]. So the MCP query tool's own refusal, "!analyzed.isIdempotent()", never fires: the tool
answers successfully and the vertex is in the database.
The guard arm that let the evaluation through, and the two bounds the lead could not settle, were
measured rather than read. See "Scope / confidence" for the three answers.
Where (HEAD 7399c0d735)
- gremlin/src/main/java/com/arcadedb/gremlin/query/GremlinQueryEngine.java:95-107, analyze(), with
- engine/src/main/java/com/arcadedb/query/QueryEngine.java:131-139, the contract, and :137 the
- engine/src/main/java/com/arcadedb/query/polyglot/PolyglotQueryEngine.java:131, the only override
- gremlin/src/main/java/com/arcadedb/gremlin/ArcadeGremlin.java:398-415 parse(), falling to
- gremlin/src/main/java/com/arcadedb/gremlin/ArcadeGremlin.java:423-424, the javadoc that already
- mcp/src/main/java/com/arcadedb/mcp/tools/MCPToolUtils.java:73-83, analyzableQueryEngine(), the
- mcp/src/main/java/com/arcadedb/mcp/tools/QueryTool.java:93-97 and
- ha-raft/src/main/java/com/arcadedb/server/ha/raft/RaftReplicatedDatabase.java:1592 and :1832, the
Repro
Added gremlin/src/test/java/com/arcadedb/gremlin/R30AnalyzeGroovyWritesTest.java (a measurement,
not committed, deleted after the run) and ran it through gremlin-it, which is where gremlin's test
classes actually execute. Command:
mvn -pl gremlin install -DskipTests ... && mvn -pl gremlin-it test -Dtest=R30AnalyzeGroovyWritesTest
Recorded output, verbatim, with the surrounding log lines dropped only where marked:
[R30] GUARD ARM: DatabaseContext=PRESENT, currentUser=null
[R30] engine=auto
[R30] count(V) before analyze = 0
...
[R30] analyze() returned: idempotent=true types=[READ]
[R30] GUARD ARM: DatabaseContext=PRESENT, currentUser=null
[R30] count(V) immediately after analyze = 1
[R30] a transaction is still active after analyze; committing it
[R30] count(V) after commit/settle = 1
[R30] count(V) after reopening the database = 1
The script was the one the lead named, "g.getGraph().addVertex('V'); g.V()". The count goes from 0
to 1 during analyze(), survives a close and reopen of the database, and the verdict analyze()
hands back is READ.
Refutation attempted
Four controls, all run in the same class, all reported below as they came back.
NAMED CONTROL, the grammar-readable form. Would have shown "analysis writes in general" (which
issue #11182 already fixed) rather than a Groovy-fallback defect:
[R30-C1] count(V) before = 0
[R30-C1] analyze() returned: idempotent=false types=[CREATE]
[R30-C1] count(V) after = 0
It refutes nothing: the gremlin-lang arm is clean and correctly classifies the write. That isolates
the Groovy fallback.
SECOND CONTROL, the same Groovy with arcadedb.gremlin.engine=java. Would have shown the fallback at
ArcadeGremlin.java:403-405 is not the gate:
[R30-C2] engine=java
[R30-C2] count(V) before = 0
[R30-C2] analyze() threw com.arcadedb.exception.CommandParsingException: Error on parsing gremlin query: Failed to interpret Gremlin query: Query parsing failed at line 1, character position at 2, error message : no viable alternative at input 'g.getGraph'
[R30-C2] count(V) after = 0
Confirms the fallback is the gate.
THIRD CONTROL, mine, not the lead's: a bound SecurityDatabaseUser whose isServerAdministrator() is
false, which is what an ordinary MCP caller binds. Would have shown the finding is unbounded:
[R30-C3] count(V) before = 0
[R30-C3] analyze() threw com.arcadedb.exception.CommandParsingException: Error on parsing command
[R30-C3] count(V) after = 0
It came back the "wrong" way for an unbounded reading, and I am reporting it as such: the guard
holds for a non-administrator and nothing is evaluated. GremlinQueryEngine.analyze wraps the
SecurityException into a CommandParsingException, which is why the message is the generic one.
FOURTH CONTROL, mine: the same with isServerAdministrator() true, which is what root binds:
[R30-C4] count(V) before = 0
[R30-C4] analyze() RETURNED: idempotent=true types=[READ]
[R30-C4] count(V) after = 1
So the defect is real on a server, for root, through a bound principal, not only for an unbound
embedded caller.
Suggested fix
Override analysisEvaluatesQuery() in GremlinQueryEngine to return true whenever the effective
engine is auto or groovy, which is the conservative answer the contract asks for and makes MCP
refuse gremlin on such a server before anything runs. Better, and what the HA follower's forward
decision also needs: have ArcadeGremlin.parse() refuse rather than evaluate when the grammar
cannot read the script and the caller asked for an analysis, so the two consumers at
RaftReplicatedDatabase.java:1592 and :1832 are covered without each having to ask. Independently of
either, the classification is wrong on its own terms: a Groovy script whose write went through the
Graph API rather than a traversal is reported as [READ], so the guarded source at
GremlinStatementAnalyzer.guarded cannot be the only thing the verdict rests on.
The guarantee then: an engine whose analysis can run the text is named as such, and every caller
that uses analyze() as a pre-check refuses it at one place instead of each discovering the hole.
Scope / confidence
Executed: the five cases above, measured on gremlin-it against the shaded jar. Read: the MCP and HA
call sites.
The three things the lead could not determine:
- Which guard arm. GremlinHostAccessGuard.checkServerAdministrator returns early for a null
- Whether a stock MCP deployment binds a server administrator. It binds a principal, always:
- Whether the HA follower's forward decision is on the Groovy arm. Yes, by reading:
Residual severity: the MCP configuration's reads-only restriction and the read-only tool contract
do not hold for a server administrator on the auto or groovy gremlin engine, and the write is
additionally reported as a read. Not privilege escalation: a non-administrator is refused. Worth
noting that the groovy engine already logs a loud RCE warning at startup
("DO NOT USE IN PRODUCTION"), so the deployment is one upstream already considers unsafe; what is
new is that the analysis path, which exists precisely to be the safe pre-check, is on it.
Dedup
Grepped the whole alltitles.txt. No title mentions groovy, analysisEvaluatesQuery, or an analysis
that evaluates. Neighbours checked: #11182 (CLOSED, "HA: one Gremlin write sent to a follower is
applied several times and still returns an error"), which fixed the gremlin-lang arm and is what
control one measures as clean, and #11170 (CLOSED, "MCP: tool annotations and a Claude Code plugin
to connect to your own ArcadeDB server"), which is where the contract comment came from.
Related advisories
This advisory and its CVE also cover the following advisories, fixed in the same release (26.11.1):
- GHSA-6jr9-6vw5-xjf6
https://github.com/ArcadeData/arcadedb/security/advisories/GHSA-6jr9-6vw5-xjf6: MCP: the two upsert tools create types with allowSchemaChange set to false, the same schema change execute_command refuses on the same server
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
mavencom.arcadedb:arcadedb-gremlin |
Corregida | 26.11.1 | 2 d | 26.11.1 no afectada |
26.11.1Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/ArcadeData/arcadedb/security/advisories/GHSA-r946-225c-5x88Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
