/

CVE-2026-67341

Severity:

CRITICAL RISK

(9.8)

Broken Script Authorization (CWE-863) in ArcadeDB JS

CVE-2026-67341

Deferred

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-863

Impact:

Privilege Escalation and Arbitrary Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

ArcadeDB fails to enforce scripting authorization checks for SQL DEFINE FUNCTION statements using LANGUAGE js, allowing non-admin users to register executable JavaScript functions.

When an attacker has database access, they can bypass intended scripting restrictions and execute arbitrary JavaScript within the database environment.

Affected context

This vulnerability appears in ArcadeDB deployments that:

  • Allow users to issue SQL DEFINE FUNCTION statements
  • Support JavaScript-based functions via LANGUAGE js
  • Rely on role- or permission-based controls to restrict scripting capabilities to administrators

The issue is most relevant where multi-tenant or shared database access exists and the database trusts that only privileged roles can register executable scripts.

Exploit preconditions

  • Attack surface: Logical database interface (SQL over network or local connection)
  • Required access: Valid database credentials with permission to execute SQL statements, but without explicit scripting/admin privileges
  • Trigger point: Submission of DEFINE FUNCTION ... LANGUAGE js statements that the server accepts without proper authorization checks
  • Why exploitation is possible: The authorization layer does not correctly enforce that only administrators can define JavaScript-backed functions, so regular users can introduce and run arbitrary JS code under elevated execution context.

Why this happens

The root cause is a missing or incomplete authorization check on the SQL DEFINE FUNCTION path when LANGUAGE js is specified.

Instead of consistently verifying that only privileged roles can create script-backed functions, the implementation treats these statements as if they were regular schema operations.

This maps to CWE-863: Incorrect Authorization, where the system fails to validate that the caller has the required permissions for an operation that enables code execution.

Abstractly, the bug pattern is: "executable scripting or stored procedures exposed through general-purpose DDL without a corresponding privilege gate."

Potential impact

  • Attackers with basic database access can execute arbitrary JavaScript in the database runtime.
  • Malicious functions can read or modify sensitive data beyond the attacker's intended role.
  • Stored JS functions can be used as persistence mechanisms, re-triggered by application logic.
  • Data integrity can be compromised through unauthorized updates, deletions, or business logic tampering.
  • In some deployments, JavaScript execution may provide a bridge to underlying system resources or services, increasing the blast radius.

General mitigation guidance

Mitigation centers on tightening authorization boundaries around scripting and executable functions.

Common defensive patterns include:

  • Ensuring that any operation introducing executable code (scripts, stored procedures, JS functions) is guarded by explicit, role-based checks.
  • Separating "schema management" privileges from "code execution" privileges, and assigning them only to trusted administrators.
  • Disabling or restricting JavaScript-backed functions in environments where they are not strictly required.
  • Applying least privilege for database roles and limiting who can issue DDL that affects functions or triggers.
  • Introducing defense-in-depth controls such as whitelisting allowed function names or modules and logging all function definition changes for review.

These measures reduce the risk even if a similar logic flaw were reintroduced in the scripting layer.

How teams detect issues like this

Detection typically involves a combination of configuration review, query auditing, and code analysis:

  • Enable and review audit logs for DEFINE FUNCTION statements, especially those specifying LANGUAGE js, to spot unexpected users defining scripts.
  • Use database security policies or monitoring tools to flag non-admin roles performing DDL involving functions or executable code.
  • In code reviews, treat any feature that introduces scripting or dynamic evaluation as high risk and validate that authorization checks exist and are enforced consistently.
  • Apply static or policy-based analysis to database migration scripts and application code to detect ungoverned use of script-backed functions.

Automated database governance tools can assist by enforcing guardrails on who can define or modify executable functions.

Sources

SourceLink
github.comgithub.com/ArcadeData/arcadedb/security/advisories/GHSA-vwjc-v7x7-cm6g
vulncheck.comvulncheck.com/advisories/arcadedb-before-authorization-bypass-via-sql-define-function

Frequently asked

questions

Exploitation is feasible wherever users beyond trusted administrators can connect to the database and issue SQL statements. Any such user may leverage the lack of authorization checks to define and execute JavaScript functions.

No. The issue specifically arises because non-admin accounts with general SQL access can perform an operation (defining JS functions) that should be restricted to administrators, effectively granting them scripting capabilities.

The safest pattern is to enforce a strict authorization gate around any SQL operation that introduces or modifies executable code, ensuring only designated administrative roles can define LANGUAGE js functions, and to centralize this check so it cannot be bypassed.

Design database and scripting features with "secure by default" access control, explicitly separating dangerous capabilities from routine operations, and implement systematic security reviews for any feature that evaluates or runs user-supplied code or scripts.

Find out what's already
exploitable in your codebase.