# GHSA-WW64-52X2-W3X2: arcadedb-native protection bypass

- Database: GitHub
- Severity: medium (stated by ghsa, no CVSS score)
- Published: 2026-11-04
- Modified: 2026-11-04

## Affected versions

- com.arcadedb:arcadedb-native (Maven): through 26.10.2

## 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).

1. Accepted by the read-only door on native and refused on JVM: 46 of the 177 shapes in `ro2`, 18 of 33 in `ro3`. Durable state changed after the call (row count, sum, type list and index count read back through `POST /command`): 38 in `ro2`, 3 in `ro3`. 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 nested `SELECT FROM (SELECT FROM (INSERT ...))`), a FROM subquery, `expand((INSERT ...))`, a WHERE or ORDER BY subquery, a function argument (`coalesce((INSERT ...), 1)`), a MATCH `where:` and RETURN subquery, a TRAVERSE start and WHILE, a sqlscript `LET $x = (INSERT ...)`, the GET form `GET /api/v1/query/{db}/sql/{statement}`, and the `record`, `graph` and `studio` serializers.
2. Top-level `PROFILE INSERT INTO T SET a = 106` and `PROFILE CREATE VERTEX T SET a = 108` run 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 INSERT` does not execute on either server.
3. 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 with `500 UnsupportedOperationException: Implement UpdateStatement.refersToParent()` (and the matching name for each statement class) instead of the 400, and no state change was observed. In `FROM (UPDATE|DELETE|...)` and `PROFILE UPDATE|DELETE|DROP TYPE` with 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.
4. The same counts (46 accepted, 38 durable in `ro2`; 18 accepted, 3 durable in `ro3`) appear on `arcadedata/arcadedb:26.11.1-SNAPSHOT-native-amd64` (main, built 2026-10-21 from 7050ef7), so the hole is still open on main.
5. 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 T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT count(*) AS n, sum(a) AS s FROM T`
- `SELECT 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 1
```

Same 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](https://github.com/ArcadeData/arcadedb/security/advisories/GHSA-84m7-76gh-rm42), which carries the CVE identifier for the group.

## References

- https://github.com/ArcadeData/arcadedb/security/advisories/GHSA-ww64-52x2-w3x2

Page: https://cve.now/GHSA-WW64-52X2-W3X2
