Skip to content

[server audit] Low-severity tail: error-response info disclosure, wrong HTTP status codes, forced System.gc, cluster-token guidance #5037

Closed

Description

@robfrank

Severity: LOW — hardening

Part of the 2026-07 server module audit. A grab-bag of small, independent low-severity items. Each can be a tiny PR.


Item 1 (security): verbose exception details leaked in HTTP error responses

server/src/main/java/com/arcadedb/server/http/handler/AbstractServerHttpHandler.java:559 (error2json), :610 (sendErrorResponse)
Error responses always include the exception class name (exception.getClass().getName()) and a detail built from the full cause chain (getMessage() of every nested cause). The SERVER_MODE gate only lowers log verbosity, not response content. An attacker probing endpoints harvests internal class names, file paths, and parse/engine errors.
Fix: in production mode return a generic message + correlation id; include detail/exception only in development mode.


Item 2 (correctness): POST /begin returns 401 for "Transaction already started"

server/src/main/java/com/arcadedb/server/http/handler/PostBeginHandler.java:51
A 401 makes clients re-authenticate for what is a state error; should be 400/409. Also a non-empty payload without isolationLevel is rejected with 400 (:59-60) though the field is documented optional elsewhere.
Fix: return 400/409; make isolationLevel truly optional.


Item 3 (correctness): HA read-consistency bookmark header parse throws 500 on bad input

server/src/main/java/com/arcadedb/server/http/handler/DatabaseAbstractHandler.java:136-137
A non-numeric X-ArcadeDB-Read-After throws NumberFormatException → HTTP 500 instead of 400.
Fix: validate and return 400 on malformed input.


Item 4 (performance/availability): System.gc() forced from the server monitor under memory pressure

server/src/main/java/com/arcadedb/server/monitor/ServerMonitor.java:164-167
When available heap is under 10% the monitor calls System.gc() — a full stop-the-world collection precisely when the server is already struggling, which can cascade into HA election timeouts. (Currently latent: the serverMonitor field is commented out in ArcadeDBServer:126.)
Fix: remove the call; log the warning and rely on the JVM collector.


Item 5 (security guidance): cluster forwarded-user auth rests on the cluster token

server/src/main/java/com/arcadedb/server/http/handler/AbstractServerHttpHandler.java:495 (validateClusterForwardedAuth)
When X-ArcadeDB-Cluster-Token matches, the server trusts X-ArcadeDB-Forwarded-User with no password check (by design for HA forwarding). The comparison is constant-time and blank tokens are rejected, so this is not directly exploitable, but when the token is not explicitly configured it is PBKDF2-derived from cluster name + root password with a fixed public salt (ha-raft/.../ClusterTokenProvider.java). A weak root password plus a reachable HTTP replication port lets an attacker forge the token and impersonate root.
Fix (mostly docs/config): recommend an explicit high-entropy arcadedb.ha.clusterToken; consider a random per-cluster salt persisted with the cluster; document that the replication HTTP port must not be exposed to untrusted networks.

Acceptance criteria

  • Production-mode error responses do not leak exception class names / cause chains (test asserts generic body + correlation id).
  • /begin returns 400/409 (not 401) for an already-started transaction; malformed X-ArcadeDB-Read-After returns 400 (not 500).
  • No forced System.gc() in the monitor path.
  • Docs updated for cluster-token hardening.
  • Small regression tests where practical.

Activity

  1. added
    java
    audit
    on Jul 6, 2026
  2. added this to the 26.7.2 milestone on Jul 6, 2026
  3. self-assigned this
    on Jul 6, 2026
  4. added a commit that references this issue on Jul 7, 2026
  5. added a commit that references this issue on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

auditbugjavasecurity

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions