llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Maven · com.arcadedb:arcadedb-server

GHSA-97H7-J68G-W3R2

On-demand HTTP database open skips the per-type ACL binding, reopening GHSA-c23x-pqcj-7hfm for the first batch request to each closed database

Parche disponible
Descargar PNG JSON
CVSS
—
high
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición15 dDesde la divulgación, 4 nov 2026, 4:25 p. m.
Detección13 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 26.11.1
Monitoreo
Detectada +1
4 nov 26
18 nov 26
20 nov 26
4 nov 26
8 nov 26
12 nov 26
16 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-97H7-J68G-W3R2 divulgada
Remediación Parche 26.11.1 com.arcadedb:arcadedb-server · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

The change that lets the HTTP layer open a database on first request (#10234, merged as PR #10260) moved the database resolve of `POST /api/v1/batch/{database}` to a method that opens the database from disk, but left the authorization binding guarded by a registry membership test taken before that resolve. The first request to a database that is on disk and not open therefore runs with no principal bound, and every per-type ACL is skipped.

This reopens GHSA-c23x-pqcj-7hfm for that request.

Affected component

`server`, at HEAD `f5b6f7d0fb`. Introduced by the on-demand open change; not present in releases before it.

Impact

For the first `POST /api/v1/batch/{database}` to each not-yet-open database after a server start, an authenticated user who may access the database at all has every per-type permission check skipped. A user holding database access plus per-type READ on some types can read and write types they are not entitled to, which is the exact bypass GHSA-c23x-pqcj-7hfm was issued for.

`GET /api/v1/progress/{database}` has the same shape, read-only and lower impact.

This is not an exotic window. The stated motivation for the change is that a server holding thousands of databases can leave them closed at start and open each on its first request, so `databaseLoadAtStartup=false` becomes a recommended configuration, and under it every database's first batch request takes this path.

Root cause

`AbstractServerHttpHandler.checkAuthorizationOnDatabase` binds the authenticated principal so the engine's per-type layer enforces. Its own javadoc states why it exists:

> Because these handlers do not extend `DatabaseAbstractHandler` (which binds the principal in its own `execute`), the engine saw a null current user and silently skipped every per-type check [...] (GHSA-c23x-pqcj-7hfm). Binding here makes the per-type layer enforce.

The binding is guarded by:

if (user != null && httpServer.getServer().existsDatabase(databaseName)) {
  final DatabaseInternal database = httpServer.getServer().getDatabase(databaseName, false, false);
  ...
  context.setCurrentUser(user.getDatabaseUser(database));
  BOUND_PRINCIPAL_DB.set(database);
}

and `ArcadeDBServer.existsDatabase` is registry-only:

public boolean existsDatabase(final String databaseName) {
  return databases.containsKey(databaseName);
}

That guard used to be sound by accident. A database not in the registry could not be used by the request either, because the handler's own resolve was `getDatabase(databaseName, false, false)`, which throws `DatabaseNotAvailableException` for a database that is not open: binding skipped, request dead.

The change replaced that resolve with `getDatabaseForRequest(databaseName)`, which checks the disk and opens the database. The guard did not move. The ordering is now:

  1. `checkAuthorizationOnDatabase` runs. The database is on disk and not open, so `existsDatabase` is false. The coarse `canAccessToDatabase` check still runs, but no principal is bound.
  2. the handler calls `getDatabaseForRequest`, which opens and registers the database.
  3. the batch runs against a `DatabaseContext` whose current user is null, and `LocalDatabase.checkPermissionsOnFile` returns at its `if (user == null) return;` arm for every bucket it touches.

`getDatabaseForRequest`'s own javadoc says "The caller has already checked that the user may access the database", which is true of the database-level check and not of the per-type binding that was skipped.

Where

  • `server/src/main/java/com/arcadedb/server/http/handler/AbstractServerHttpHandler.java`, `checkAuthorizationOnDatabase`, the `existsDatabase` guard (around line 2207).
  • `server/src/main/java/com/arcadedb/server/http/handler/PostBatchHandler.java:367` (the guard) and `:540` (the resolve changed to `getDatabaseForRequest`).
  • `server/src/main/java/com/arcadedb/server/http/handler/GetProgressHandler.java:62`.
  • `server/src/main/java/com/arcadedb/server/ArcadeDBServer.java`, `existsDatabase` and `getDatabaseForRequest`.
  • `engine/src/main/java/com/arcadedb/database/LocalDatabase.java:1064-1073`, `checkPermissionsOnFile`, the `user == null` no-op arm.

Affected handlers, and why the rest are clean

The two handlers that are database-scoped but do not extend `DatabaseAbstractHandler`, and therefore call `checkAuthorizationOnDatabase` by hand, are `PostBatchHandler` and `GetProgressHandler`, and both are affected. Every other former member of that family (time series, PromQL, Grafana, Prometheus read and write) has since been moved onto `DatabaseAbstractHandler`, which binds the principal after it resolves the database and is therefore clean.

Census commands:

rg --no-ignore -n "checkAuthorizationOnDatabase" server/ metrics/ --glob '*.java' | grep -v AbstractServerHttpHandler.java
rg --no-ignore -n "getDatabaseForRequest" server/ --glob '*.java'

Suggested fix

Bind the principal from the same database object the request will use, rather than from a registry test taken before the request resolves it: resolve first through `getDatabaseForRequest`, then bind. Alternatively, make `checkAuthorizationOnDatabase` itself resolve through `getDatabaseForRequest` so the two can never disagree.

The guarantee that would stop the class recurring: the broken rule is wider than these two call sites, since any future handler that resolves through `getDatabaseForRequest` after calling `checkAuthorizationOnDatabase` inherits the same hole. A test that asserts, for every database-scoped handler, that a request to a database present on disk but absent from the registry ends with a bound principal would hold for handlers not yet written. A source-level census in the shape of the existing `ProtocolContextCensusTest` would also work.

Credit

Reported by @ruispereira.

---

Update 2026-10-21: no fix anywhere, still present at main

Re-checked against main after the 2026-10-20 work. The guard is byte for byte what the original report described.

`AbstractServerHttpHandler.checkAuthorizationOnDatabase`:

if (user != null && httpServer.getServer().existsDatabase(databaseName)) {
  final DatabaseInternal database = httpServer.getServer().getDatabase(databaseName, false, false);
  ...
  context.setCurrentUser(user.getDatabaseUser(database));
}

`ArcadeDBServer.existsDatabase` is still registry-only:

public boolean existsDatabase(final String databaseName) {
  return databases.containsKey(databaseName);
}

`git log -L` over those lines returns only the original per-type ACL fix and issue #5161, both of which predate the on-demand open change. There is no commit anywhere that addresses this, and the regression base is the on-demand open change itself, so it has been live for the whole period.

The ordering is unchanged: `PostBatchHandler` calls `checkAuthorizationOnDatabase` before it resolves, and opens through `getDatabaseForRequest` afterwards.

The census, completed

Handlers that are database-scoped but do not extend `DatabaseAbstractHandler`, and therefore call `checkAuthorizationOnDatabase` by hand: exactly `PostBatchHandler` and `GetProgressHandler`. Both are affected. The ten observability and time-series handlers whose javadoc still mentions the call have since been reparented under `DatabaseAbstractHandler` and are safe. `GetExistsDatabaseHandler` takes a database parameter but never resolves or opens one, so it is safe.

All three callers of `getDatabaseForRequest`:

| caller | verdict |
|---|---|
| `DatabaseAbstractHandler` | safe: it resolves first and binds from that same object, with no registry test |
| `PostBatchHandler` | affected |
| `WebSocketInsertSessionManager` | safe: coarse access check, then it opens, then it binds the principal from that same database object on every chunk |

The WebSocket insert path was not examined in the original report and is clean.

Why the existing tests cannot see it

The per-type ACL integration test drives `POST /api/v1/batch` against a database that is already open, so `existsDatabase` is true and the test passes on a vulnerable build. `GetProgressHandler`'s own test fixture javadoc records the skipped binding as "correctly skipped". The original per-type ACL fix has a regression test; this regression has none, and the existing test is structurally unable to see it because it has no cold-start case where the database is absent from the registry.

Suggested fix

Drop the `existsDatabase` conjunct and bind from the database object the request actually uses, as `DatabaseAbstractHandler` already does: either move the binding to just after `getDatabaseForRequest` in the two hand-callers, or add a `checkAuthorizationOnDatabase` overload that takes the resolved `DatabaseInternal`. A second registry test would reintroduce the same defect in a different place.

A regression test needs a database that exists on disk and is not in the registry, which is the one state the current tests never construct.

---

Update 2026-10-22: still unfixed, verified again at main

`AbstractServerHttpHandler.checkAuthorizationOnDatabase` still binds the principal only inside
`if (user != null && httpServer.getServer().existsDatabase(databaseName))`, and `existsDatabase` is
still one line, `databases.containsKey(name)`. `PostBatchHandler` still checks before it resolves
and opens through `getDatabaseForRequest` afterwards.

Census of the two hand-callers is complete and unchanged: `PostBatchHandler` and
`GetProgressHandler`. The observability and time-series handlers were reparented onto
`DatabaseAbstractHandler`, which resolves first and then binds unconditionally, and are safe.
`WebSocketInsertSessionManager`, the third `getDatabaseForRequest` caller, is also safe: it binds
the principal from the same database object on every chunk.

Why no existing test can see this

`UngatedHandlerPerTypeAclIT` and `BatchParallelFlushPerTypeAclIT` both run with
`SERVER_DATABASE_LOADATSTARTUP` at its default `true`, so the database is always registered before
the request arrives and `existsDatabase` is true. A regression test needs a database that exists on
disk and is absent from the registry, which is the one state none of the current tests construct.

`GetProgressHandler` shares the shape but reads only the progress registry, so it is latent rather
than live.

---

Validation update 2026-10-23

Both reported vulnerabilities are fixed. Two small residuals follow.

I re-validated all four reports against the hardening work, each against its own report rather than
the commit message. All four come back COMPLETE, every fix has a test, and I made each test inert
and re-ran it: none was inert, and in each case the failure on the inert tree reproduces the
original report verbatim, including the admin group coming back widened for the groups-file case.

Worth saying explicitly: the rename fix also closes an escape I did not report, detaching a
non-empty bucket from a restricted type. And `stop()` no longer takes the policy lock before
cancelling, so the shutdown stall is gone.

Two residuals remain. Neither is the reported vulnerability and neither needs an embargo in my view,
but both belong in this thread rather than a public issue.

1. A type alias still leaks the sample count of a denied TIMESERIES type

`LocalDatabase.countType` gates on the name the caller passed rather than on `type.getName()`, and
an alias is not a key of the access snapshot, so the default-allow arm fires:

public long countType(final String typeName, final boolean polymorphic) {
  ...
  final DocumentType type = schema.getType(typeName);
  ...
  checkPermissionsOnType(typeName, SecurityDatabaseUser.ACCESS.READ_RECORD);

`SELECT count(*)` through the alias answers, while reads and writes through the same alias are
still refused. Record-backed types are unaffected. Gating on `type.getName()` is a one line change.

This is the same shape as the rename escape: a permission keyed by a name, consulted with a name
the caller chose. The narrower patch closes the rename route; the alias route is the other way to
present a second name for the same type.

2. "A reload never writes the live file" is still conditional

With a root password configured, a reload that needs it is applied rather than refused, and
`server-users.jsonl` is rewritten from memory. No loop, no stall, no widening, so this is a much
smaller thing than what was reported. I mention it only because the guarantee as stated in the class
is unconditional and this is the one case where it does not hold.

One observation, not a finding

On the MongoDB side an empty or `$`-prefixed database name still takes the admin branch, so a
command there is authenticated but not checked against `canAccessToDatabase` and runs with no
principal bound. That is unchanged from before the fix and I could not reach it by any supported
route that creates such a database, so I am noting it rather than reporting it.

---

Update, 2026-10-25, re-validated at main d9faba8ca3

The reported route is fixed and holds. `PostBatchHandler.java:540` now binds from the resolved
instance. We censused the wider surface the original report did not cover: `getDatabaseForClient`
across Postgres, Bolt, Redis, gRPC, Gremlin, MCP, the AI tools and Mongo, and all of them bind from
the resolved instance. `getDatabaseForRequest` has three callers and all three are clean.

Two notes on where the guard sits.

The guard is at the call site, not at the authority

`checkAuthorizationOnDatabase` still carries the `existsDatabase` registry test. The rule that a
caller must bind from the resolved instance is now stated as a javadoc "MUST" rather than enforced
by the signature or by a check. The next handler written is as free to get this wrong as
`PostBatchHandler` was.

The census we asked for was not delivered

What landed is one behavioural case on one handler, plus prose. There are now two helpers for the
one rule, `bindPrincipal` for HTTP and `DatabaseUserContext` for everything else, with no census
over either.

What would make it unbreakable: a census in the shape of the one shipped for the OP_QUERY fix,
enumerating every route that resolves a database for a request from the source of truth rather than
from a hand-written list, and asserting each binds the principal from the resolved instance. A test
that enumerates handlers by hand would not have caught the original report either.

Versiones

Rangos afectados

Afectada Corregida Última
com.arcadedb:arcadedb-server≥ 26.11.1-SNAPSHOT < 26.11.1
26.11.1-SNAPSHOT
26.11.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
mavencom.arcadedb:arcadedb-server
Corregida 26.11.1 0 d 26.11.1 no afectada
Versiones corregidas26.11.1
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/ArcadeData/arcadedb/security/advisories/GHSA-97h7-j68g-w3r2

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.