Summary
Twenty CRM versions 1.15.0 and earlier contain a code injection vulnerability in the local.driver.ts module that can allow a remote attacker to execute arbitrary code on the server.
When untrusted input is incorporated into dynamically generated code, an attacker can craft requests that cause the application to run attacker-controlled logic with the server's privileges.
Affected context
This vulnerability affects deployments of Twenty CRM at version 1.15.0 and earlier where the local.driver.ts module is reachable over the network as part of normal application functionality.
It typically arises when server-side logic within this module interprets or evaluates user-supplied data as code or executable expressions without sufficient validation or restriction.
The risk is higher in environments where the CRM server has broad access to internal systems, file storage, or sensitive business data.
Exploit preconditions
- Attack surface: Network-accessible Twenty CRM endpoints that rely on logic in
local.driver.ts - Required access: Ability to send crafted requests to the affected functionality (usually unauthenticated or low-privileged, depending on deployment)
- Trigger point: Application paths in
local.driver.tsthat construct or evaluate code, commands, or expressions based on request parameters or stored data - Why exploitation is possible: User-controlled input is incorporated into dynamically executed code or interpreter contexts without robust sanitization, escaping, or use of safer, non-evaluating APIs
Why this happens
The core issue maps to CWE-94: Improper Control of Generation of Code ('Code Injection').
Within the local.driver.ts module, application logic likely constructs code snippets, expressions, or dynamic handlers using runtime data that can be influenced by remote clients.
When these dynamically built constructs are passed to evaluators (such as eval-like mechanisms, dynamic function constructors, templating engines, or script interpreters) without strict control, attackers can inject arbitrary code fragments.
This pattern breaks the assumption that configuration or user input is passive data and instead treats it as executable logic, enabling execution of attacker-chosen operations under the CRM server's security context.
Potential impact
- Remote execution of arbitrary code on the CRM server
- Read, modification, or deletion of CRM data, including contacts, deals, and activity records
- Theft of authentication tokens, API keys, or other secrets accessible to the CRM process
- Pivoting to internal services or databases reachable from the compromised host
- Deployment of backdoors, web shells, or persistent malicious logic within the application
- Disruption of business operations through service downtime or data corruption
General mitigation guidance
Effective mitigation focuses on eliminating dynamic code evaluation of untrusted data and reducing the privileges of the affected component:
- Replace any use of generic code-evaluation APIs (e.g.,
eval, dynamicFunctionconstructors, or interpreter hooks) with static, declarative logic and whitelisted operations. - Treat all external input (HTTP parameters, headers, payloads, configuration values) as untrusted and ensure it is handled strictly as data, not as code templates.
- Introduce strict validation and allowlists for any user-controllable fields that influence behavior, limiting them to safe, predefined values or schemas.
- Encapsulate any necessary expression handling using safe interpreters or sandboxed engines that cannot access the broader runtime or filesystem.
- Run the CRM service under least-privilege accounts with minimal filesystem and network access, to limit blast radius if a similar issue occurs.
- Separate sensitive auxiliary services (databases, file stores, internal APIs) onto network segments with additional access controls.
How teams detect issues like this
Organizations can detect this class of vulnerability using a combination of code-centric and behavior-centric techniques:
- Static analysis: Configure linters and SAST tools to flag usage of dynamic evaluation constructs (
eval, dynamic function builders, insecure template evaluation) withinlocal.driver.tsand related modules, especially where arguments can derive from HTTP input or database fields. - Code review: During manual reviews, highlight any pattern where request data influences code paths, expression strings, or configuration-driven logic; insist on clear separation between code and data.
- Security tests: Use dynamic application security testing (DAST) and fuzzing with benign payloads designed to detect when inputs are evaluated as code (e.g., causing syntax errors that surface in logs or responses).
- Runtime monitoring: Enable application and server logging that captures anomalies such as unexpected exceptions in expression evaluators, creation of new processes, or unusual file and network activity originating from the CRM process.

