Skip to content
eastbaycyber

CVE-2026-46624: Twenty CRM SQL Injection Enables RCE

CVSS · Critical
9.9
In CISA KEV
No
Published
Nov 7
Patch SLA & TriageVector: Network
24 to 48 hours

Critical CVSS (9.9) reachable over network.

Exposure:
Control:
CVSS v3.1 Blast RadiusScore: 9.9
Decode Vector & Sub-Scores →
CVE explainers 10 min read
Security Research Desk Source-checked
Auto-checked against the official CVE record · Human-reviewed after publishing · Updated 2026-11-07
Threat Intelligence
1GitHub refs
▲ Escalation ViewOne CVE, briefed at three altitudes — skim the Brief, weigh the Impact, or work the Runbook. The way a SOC actually reads it.
CISOBrief · 30-second brief

TL;DR - CVE-2026-46624 is a critical authenticated SQL injection-to-RCE vulnerability in Twenty CRM 1.7.7 through 1.16.7. - Risk is highest when the application connects to PostgreSQL with a superuser account. - No confirmed in-the-wild exploitation or public PoC is identified in the supplied data. - Upgrade using the vendor advisory, remove unnecessary PostgreSQL superuser privileges, restrict exposure, and investigate affected hosts.

AnalystImpact · assess the risk

Are You Affected?

CVE-2026-46624 is a critical Twenty CRM vulnerability affecting versions 1.7.7 through 1.16.7, inclusive. Twenty is an open-source CRM application. The vulnerable request path involves the REST API’s groupBy functionality and the timeZone field within the group_by query parameter.

Field Details
CVE CVE-2026-46624
Product Twenty CRM
Affected versions 1.7.7 through 1.16.7, inclusive
CVSS base score 9.9 Critical
CVSS vector Not included in the supplied NVD data
Attack vector Network-based API request
Authentication Authenticated user required, according to the NVD description
Privileges required An authenticated application account is required; the exact CVSS privileges component is unavailable
Impact SQL injection leading to operating-system command execution under specific PostgreSQL conditions
Patch available A fixed version is not identified in the supplied NVD data
CISA KEV No

Organizations running any listed version should treat the deployment as potentially affected until the vendor advisory confirms a patched release and the upgrade has been completed. Authentication narrows the attacker pool, but it does not make the issue low risk. Compromised credentials, excessive account provisioning, weak tenant controls, or an exposed login surface can make authenticated exploitation practical.

The PostgreSQL configuration is a major risk modifier. The described command-execution chain depends on the application’s PostgreSQL account having superuser privileges. A deployment using a non-superuser, least-privileged database role may block the final operating-system command-execution step, but it can remain vulnerable to SQL injection and data access. Do not use database-role hardening as a replacement for upgrading.

Analyst’s Take: Treat this as an upgrade-first issue, with database privilege reduction as an immediate containment measure rather than a fix. The absence of confirmed exploitation or a public PoC does not offset the 9.9 rating and the possibility of host-level command execution when the application database role is a PostgreSQL superuser.

For broader security context, see our DORA guidance for third-party vendors and cloud providers.

The Fix, If You’re in a Hurry

The supplied NVD information does not state a fixed Twenty version. The authoritative remediation source is Twenty’s security advisory, GHSA-jgx4-6mr9-9573:

https://github.com/twentyhq/twenty/security/advisories/GHSA-jgx4-6mr9-9573

Before changing production systems, confirm the advisory’s patched release and deployment instructions. Do not assume that upgrading to the newest currently available image or package is sufficient unless the release notes or advisory explicitly identify the fix. Record the running version, back up the database, test the upgrade in a staging environment, and verify the deployed image or package digest after rollout.

For a containerized deployment, the exact image tag must come from the vendor advisory or the organization’s approved release process. A generic command illustrates the required workflow without asserting an unverified fixed tag:

# Confirm the currently deployed version first
docker compose exec twenty ./path/to/version-command

# Replace <vendor-confirmed-fixed-tag> with the release named by Twenty
export TWENTY_IMAGE_TAG="<vendor-confirmed-fixed-tag>"
docker compose pull
docker compose up -d
docker compose ps

If a fixed release cannot yet be confirmed, apply compensating controls immediately:

  • Restrict access to the Twenty API through a VPN, identity-aware proxy, or allowlist.
  • Disable unnecessary public exposure.
  • Review user accounts, sessions, and API tokens.
  • Ensure the application database role is not a PostgreSQL superuser.
  • Monitor database and host activity for signs of exploitation.
  • Prepare to rotate credentials accessible to the application or database process.

The role change requires testing because Twenty may depend on permissions beyond ordinary table access.

-- Run as an administrative PostgreSQL role.
-- Review first; do not execute blindly in production.
SELECT rolname, rolsuper
FROM pg_roles
WHERE rolname = '<twenty_application_role>';

ALTER ROLE <twenty_application_role> NOSUPERUSER;

The role change can prevent COPY TO PROGRAM execution by the application account, but it does not remove the underlying injection flaw. Continue to patch and monitor for evidence of prior compromise.

How This Vulnerability Works

The reported root cause is unsafe construction of a SQL expression in Twenty’s group-by query handling. The timeZone value supplied inside the group_by query parameter is reportedly inserted directly into a raw SQL expression using JavaScript template literals. The value is not parameterized, validated, or escaped before reaching the database query.

The affected code path identified by the NVD record is:

engine/api/graphql/graphql-query-runner/group-by/resolvers/utils/get-group-by-expression.util.ts

In simplified form, the vulnerable pattern is equivalent to constructing SQL with untrusted input embedded in a string:

// Conceptual pattern only; not an exploit
const expression = `some_sql_expression AT TIME ZONE '${timeZone}'`;

The exact implementation and remediation should be taken from the vendor’s source and advisory. The security issue is the trust boundary: a request-controlled value enters SQL syntax rather than being passed as a safely bound parameter or accepted only from a strict allowlist.

The NVD description states that an attacker can chain this SQL injection with PostgreSQL’s COPY TO PROGRAM capability. PostgreSQL can use that capability to invoke an operating-system command, but it requires sufficient database privileges. Consequently, the complete RCE path depends on the application’s database connection operating as a PostgreSQL superuser or otherwise possessing the required permissions.

This is an application-to-database-to-operating-system escalation chain. The vulnerable endpoint is reachable over the network, but the description requires an authenticated user. The potential impact includes compromise of the database host, access to application secrets, manipulation or theft of CRM data, and lateral movement using credentials or network access available to the database process.

Severity, Explained

The reported CVSS base score is 9.9, Critical. The supplied NVD record does not include the CVSS vector string, so the individual metric values cannot be quoted reliably. Defenders should not infer exact values for attack complexity, privileges required, user interaction, scope, confidentiality, integrity, or availability from the score alone.

The high score is consistent with a network-reachable API vulnerability that can result in arbitrary operating-system command execution. Although authentication is required according to the vulnerability description, many CRM deployments expose login services to the internet and may have a broad population of users, service accounts, integrations, or API tokens. The impact is especially severe when the database server hosts the application, stores cloud credentials, or can reach internal management systems.

Deployment context still matters. A database account with superuser privileges substantially increases the likelihood that SQL injection becomes host-level command execution. A non-superuser account may limit the demonstrated chain, but the application can still be exposed to unauthorized query manipulation, data disclosure, or data modification. Network segmentation, egress controls, credential isolation, and host monitoring therefore remain important even after database privileges are reduced.

Is It Being Exploited?

CVE-2026-46624 is not listed in the CISA Known Exploited Vulnerabilities catalog based on the supplied lookup. No CISA date added, federal remediation deadline, required action, or ransomware-campaign designation applies. The available research also does not identify confirmed exploitation in the wild.

The supplied NVD record references Twenty’s GitHub security advisory but does not identify a separate public proof-of-concept repository. The current evidence therefore supports the following status: no confirmed in-the-wild exploitation identified and no separate public PoC identified in the supplied sources. This status can change after disclosure, and absence from KEV is not evidence that exploitation is impossible.

Treat the vulnerability as high priority despite the current exploitation status. The attack chain is technically straightforward for an attacker who has valid credentials and reaches the affected endpoint, particularly in deployments that use a PostgreSQL superuser. Investigate suspicious activity retrospectively rather than waiting for a KEV listing or public exploit publication.

ResponderRunbook · act now

Detecting It in Your Environment

Start with asset and version inventory. Identify every Twenty deployment, including Docker, Kubernetes, cloud images, source-based installations, and test environments. Confirm whether each deployment falls within 1.7.7 through 1.16.7 and document the PostgreSQL hostname, database role, network exposure, and authentication model.

Review application access logs for authenticated requests using the group-by functionality, especially requests containing groupBy, group_by, or timeZone. A suspicious request may contain malformed SQL metacharacters, unusually long parameter values, encoded quotes, comment markers, or unexpected operators. Because benign clients may use different parameter encodings, tune detections against a baseline and correlate with account identity, source address, response status, and database activity.

Example web-log searches:

# Search common access-log formats for the affected query concepts.
grep -Ei 'group[_]?by|timeZone|timezone' /var/log/nginx/access.log

# Review encoded and suspicious-looking requests.
grep -Ei 'group[_]?by|timeZone|timezone|%27|%22|%3B|--|/\\*|\\bcopy\\b' \\
  /var/log/nginx/access.log

These searches are triage aids, not a complete exploit signature. The vulnerable parameter may be encoded, normalized by a proxy, or recorded only in application logs. Preserve the original request URL where policy permits, and compare requests with PostgreSQL logs using timestamps, request IDs, database usernames, and source addresses.

PostgreSQL monitoring should focus on unexpected use of COPY, particularly attempts involving PROGRAM, and on commands launched by the database service account. The following query can help identify sessions that are currently using a superuser role:

SELECT pid, usename, application_name, client_addr, backend_start, state, query
FROM pg_stat_activity
WHERE usename IN (
  SELECT rolname FROM pg_roles WHERE rolsuper = true
)
ORDER BY backend_start DESC;

If PostgreSQL statement logging is enabled, search collected logs for indicators such as:

COPY ... PROGRAM
COPY TO PROGRAM
COPY FROM PROGRAM

A simple host-based search might include:

grep -Eai 'COPY[[:space:]]+(TO|FROM)[[:space:]]+PROGRAM' \\
  /var/log/postgresql/*.log

Also inspect process execution telemetry on the database host. A database service spawning shells, interpreters, download utilities, or unfamiliar binaries is suspicious, particularly when the parent process is postgres or the database container entrypoint. Review child-process events, outbound connections, newly created files, modified startup tasks, and access to environment files or cloud metadata services.

If indicators are found:

  1. Isolate the host or affected application.
  2. Preserve logs and volatile evidence.
  3. Rotate credentials accessible to the application or database process.
  4. Review account and token activity.
  5. Check for persistence and lateral movement.
  6. Follow the organization’s incident-response procedures.

Hardening Priorities

Reducing database privileges is the most important immediate containment step when a Twenty deployment uses a PostgreSQL superuser. Confirm that the application role has only the permissions required for normal operation. Review grants on databases, schemas, tables, sequences, functions, and extensions rather than relying only on the rolsuper flag.

Also apply the following controls:

  • Keep the Twenty API behind an authenticated gateway or private network where practical.
  • Restrict database connectivity so only the application can reach the database listener.
  • Apply egress filtering to limit unauthorized outbound connections from the database host.
  • Store database credentials and application secrets in a managed secrets system.
  • Avoid placing unrelated services or sensitive credentials on the same host.
  • Enable sufficient application, proxy, database, and host logging.
  • Alert on unusual API parameters and database child-process creation.
  • Review and revoke stale users, sessions, and API tokens.
  • Test backups and prepare a rollback plan before upgrading.

These measures reduce blast radius but do not replace vendor remediation.

For additional background on security terminology, see our FIDO2 overview and implementation guide.

References and Further Reading

The primary technical references are the NVD record and Twenty’s security advisory. The advisory should be treated as authoritative for the patched release, implementation details, and vendor-recommended upgrade path. Because the supplied NVD data does not identify a fixed version, verify the remediation version directly before declaring the issue resolved.

Defenders should retain evidence of the version deployed, the fixed version selected, the database role permissions before and after remediation, and the logs reviewed. If the vendor advisory later publishes a fixed version or additional indicators, update vulnerability-management records and detection content accordingly.

This article may contain affiliate links. We earn a commission on qualifying purchases at no extra cost to you.

Last verified: 2026-11-07

Disclaimer: This article may contain affiliate links. We earn a commission on qualifying purchases at no extra cost to you.