/

CVE-2026-27702

Severity:

CRITICAL RISK

(9.9)

Server-Side Code Injection in Budibase Cloud View Filtering

CVE-2026-27702

Analyzed

Vulnerability type

Category:

Server-Side Code Injection

CWE:

CWE-20, CWE-94, CWE-95

Impact:

Remote Code Execution and Sensitive Data Exposure

Severity:

CRITICAL RISK

(9.9)

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

Budibase Cloud's view filtering implementation contained an unsafe eval() call that allowed any authenticated user to run arbitrary JavaScript on the server.

When a user supplied a custom view map function, the server evaluated it directly, enabling access to sensitive environment variables and backend services within the app-service pod.

Affected context

This vulnerability occurs in Budibase Cloud (SaaS) deployments that use the in-memory view implementation in packages/server/src/db/inMemoryView.ts.

It is triggered when user-defined view map functions are passed to the server for filtering and are executed via eval() in the Node.js runtime.

Self-hosted Budibase instances relying on native CouchDB views do not share this execution path and are not affected under the described conditions.

Exploit preconditions

  • Attack surface: Budibase Cloud API/interface that accepts view filtering or custom view map functions.
  • Required access: Any authenticated Budibase Cloud user account, including free-tier tenants.
  • Trigger point: Submission or modification of a view filter/map function that the server processes and evaluates for in-memory views.
  • Why exploitation is possible: The server passes user-controlled JavaScript directly into eval() without adequate validation, sandboxing, or restriction, effectively granting the user the ability to run arbitrary code in the app-service process context.

Why this happens

The bug stems from executing user-supplied JavaScript in a highly privileged server process using eval() without robust validation or isolation.

This maps primarily to CWE-94: Improper Control of Generation of Code ('Code Injection'), where attackers can inject and execute code by influencing dynamically constructed scripts.

It is also related to CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code, as the dynamic evaluation mechanism treats user input as code, and CWE-20: Improper Input Validation, because the system assumes benign input and does not constrain what the map function is allowed to do.

In abstract, the insecure pattern is: treat user-specified "logic" as trusted and execute it via eval() in the same environment that holds secrets and privileged capabilities.

Potential impact

  • Execution of arbitrary JavaScript code on the server in the app-service pod context.
  • Extraction of sensitive environment variables such as INTERNAL_API_KEY, JWT_SECRET, CouchDB admin credentials, and cloud provider keys.
  • Direct access to the backing CouchDB instance, including enumeration of tenant databases.
  • Reading user records, including email addresses and potentially other application data.
  • Use of internal API keys and secrets to pivot to other internal services or infrastructure.
  • Impersonation of users or forging of tokens if JWT or auth-related secrets are exposed.
  • Potential large-scale data exfiltration or multi-tenant data exposure within the affected environment.

General mitigation guidance

Effective mitigation focuses on removing dynamic code execution of user-controlled input and tightening trust boundaries around server-side logic:

  • Replace eval()-based execution of user-defined functions with declarative, data-driven filters (e.g., query builders, whitelisted operators, or expression interpreters that treat input as data, not code).
  • Where custom logic is necessary, use constrained execution environments or sandboxed interpreters with strict capability limits, rather than running code in the main server process.
  • Enforce strong input validation and structural schemas for any "view" or "map" definitions; allow only a limited, well-defined subset of operations.
  • Segregate sensitive secrets from application processes that must process user-supplied "logic," using separate services, minimal-privilege credentials, and secret-scoping.
  • Apply least-privilege principles for pods and services: ensure that the process handling user-defined filters has only the minimal environment variables and permissions it truly needs.
  • Regularly review use of dynamic evaluation mechanisms (eval, Function, vm in Node.js, or similar constructs in other languages) and remove or isolate them as part of secure coding standards.

How teams detect issues like this

Detection and prevention can be supported through a combination of code-level analysis and runtime monitoring:

  • Static analysis: Configure SAST tools or custom linters to flag any use of unsafe dynamic evaluation functions (eval, new Function, vm.runInThisContext, etc.) in server-side code, especially where arguments are derived from request data.
  • Code review practices: Establish code review checklists that explicitly question any dynamic code execution, custom scripting features, or user-configurable logic, requiring justification and sandboxing.
  • Configuration and policy enforcement: Use organizational coding standards and pre-commit hooks to prevent introduction of eval() and similar APIs in backend code paths.
  • Runtime monitoring: Instrument logging around view execution and server-side dynamic behavior to detect anomalous, complex, or suspicious view definitions and unexpected errors indicative of code injection attempts.
  • Secret access monitoring: Track access to environment variables and backend databases to identify unusual patterns that could indicate exploitation or reconnaissance.

Sources

SourceLink
github.comgithub.com/Budibase/budibase/commit/348659810cf930dda5f669e782706594c547115d
github.comgithub.com/Budibase/budibase/pull/18087
github.comgithub.com/Budibase/budibase/releases/tag/3.30.4
github.comgithub.com/Budibase/budibase/security/advisories/GHSA-rvhr-26g4-p2r8

Frequently asked

questions

Any authenticated Budibase Cloud user, including free-tier tenants, can potentially exploit this issue via the interface or API that accepts view filter or map definitions. The attack is carried out remotely against the Budibase Cloud backend.

No specific administrative privileges are required. The vulnerability resides in a feature accessible to normal authenticated users, so basic account access in Budibase Cloud may be sufficient.

The most robust fix is to eliminate the use of eval() and other dynamic code execution mechanisms for user-supplied content and replace them with declarative, data-driven constructs or sandboxed interpreters that do not expose server internals or secrets.

Avoid dynamic evaluation of user input by design, enforce strict input validation for any configuration or "logic" fields, implement secure coding standards that ban or tightly control eval()-style APIs, and regularly run automated static analysis and security reviews focused on dynamic code execution patterns.

Find out what's already
exploitable in your codebase.