/

CVE-2026-44706

Severity:

HIGH RISK

(8.5)

SQL Injection in Chatwoot Conversation and Contact Filters

CVE-2026-44706

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution within Application Database

Severity:

HIGH RISK

(8.5)

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

A SQL injection vulnerability in Chatwoot's conversation and contact filter APIs allows authenticated users to inject arbitrary SQL when filtering on custom attributes of type date or number using comparison operators.

Because user-supplied filter values are interpolated directly into SQL without parameterization, an attacker can perform time-based blind SQL injection to exfiltrate or manipulate data within the application database.

Affected context

The vulnerability appears in Chatwoot deployments where:

  • Users can authenticate and access at least one account
  • Conversation and contact filtering is exposed via:
  • POST /api/v1/accounts/{account_id}/conversations/filter
  • POST /api/v1/accounts/{account_id}/contacts/filter
  • POST /api/v1/accounts/{account_id}/custom_attribute_definitions
  • Custom attributes of type date or number are used in filters
  • The is_greater_than or is_less_than operators are accepted and processed

In these contexts, filter payloads are transformed into SQL where user-controlled values end up directly embedded into query fragments.

Exploit preconditions

  • Attack surface: Application API endpoints for conversation, contact, and custom attribute filters.
  • Required access: Valid authenticated user account with permission to call the affected APIs for a given account_id.
  • User-controlled input: The values field in the filter payload when filtering on custom attributes of type date or number with is_greater_than or is_less_than.
  • Trigger point: Server-side request handling that builds dynamic SQL strings from filter conditions and interpolates the values array without using prepared statements or parameter binding.
  • Why exploitation is possible: The filter implementation concatenates raw user input into SQL expressions, allowing crafted values to alter the query structure and enabling time-based blind SQL injection techniques.

Why this happens

The core issue is dynamic SQL construction without proper parameterization, an instance of CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Instead of using bound parameters or an ORM query builder, the filtering logic for custom attributes constructs SQL fragments by directly interpolating user-supplied values into comparison expressions for date and numeric fields. Because this logic does not enforce strict typing or escape special characters at the query layer, attackers can craft values that break out of the expected literal context and inject additional SQL. The bug is conceptual: treating query structure and untrusted filter data as a single concatenated string rather than separating them via parameter binding and whitelisted operators.

Potential impact

  • Attackers may read sensitive data from tables accessible to the application, including conversations, contacts, and related metadata.
  • Attackers could modify or delete records (e.g., conversations, contacts, or custom attribute definitions) within the database.
  • Attackers may escalate their logical permissions by manipulating account-related data, depending on schema and business logic.
  • Attackers could perform time-based blind probing of the database schema and configuration, aiding further compromise.
  • Attackers might impact application availability by crafting queries that cause long-running operations or lock contention.

General mitigation guidance

Effective mitigation focuses on structurally separating query logic from untrusted data and minimizing the scope of dynamic SQL:

  • Use parameterized queries or ORM query builders so that all user-supplied values, including filter values, are passed as bound parameters rather than concatenated into SQL strings.
  • Restrict filter operators and fields to a well-defined whitelist and avoid building arbitrary SQL fragments based on user-controlled strings.
  • Enforce strict type handling for numeric and date inputs at the API boundary, rejecting values that cannot be safely parsed into expected native types before reaching the data access layer.
  • Implement centralized query-construction utilities for dynamic filtering instead of ad hoc string concatenation, ensuring consistent use of parameterization patterns.
  • Apply least-privilege database roles so that the application account only has the minimum required permissions, reducing the blast radius of any injection.

How teams detect issues like this

Detection can focus on both code-level and operational signals:

  • Static analysis: Configure rules to flag any SQL construction patterns that use string concatenation or interpolation with request-derived data (e.g., filter parameters, JSON fields), especially in filtering or reporting modules.
  • Code review: During manual review, pay attention to dynamic filter/query builders and ensure they rely on prepared statements or ORM abstractions rather than raw SQL strings assembled from user input.
  • Unit and integration tests: Add tests that supply unexpected characters and SQL metacharacters in filter values to verify they are safely handled or rejected.
  • Runtime monitoring: Use database logs or an intrusion detection layer (e.g., WAF or database firewall) to detect anomalous queries, such as those containing time-delay functions or unusual control structures that suggest time-based blind probing.
  • Policy enforcement: Adopt coding standards that prohibit direct concatenation of user input into SQL and enforce them via automated checks in the CI/CD pipeline.

Sources

SourceLink
github.comgithub.com/chatwoot/chatwoot/security/advisories/GHSA-9pgm-75gg-6948

Frequently asked

questions

Exploitation is limited to authenticated users who can access the affected account APIs, but within that scope any such user can craft filter payloads that trigger SQL injection, regardless of whether they are administrators or standard agents.

No elevated privileges are strictly required; an attacker only needs valid credentials and sufficient access to invoke the conversation or contact filter endpoints for a target account. The vulnerability arises in the filter handling logic, not in role checks.

The most robust fix is to replace any dynamic SQL string construction with parameterized queries or ORM-based query builders. All filter values should be passed as bound parameters, and only preapproved operators and fields should influence query structure.

Adopt a defensive design where query structure is fully defined in code and never derived from raw user input, enforce strong typing on all externally supplied values, and institutionalize secure coding standards with automated checks that flag direct string interpolation in data access layers.

Find out what's already
exploitable in your codebase.