/

CVE-2026-22243

Severity:

HIGH RISK

(8.8)

SQL Injection in EGroupware Nextmatch Filter Processing

CVE-2026-22243

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL command execution within the application database context

Severity:

HIGH RISK

(8.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

EGroupware's core Nextmatch filter processing contains a SQL injection flaw where attacker-controlled values can be injected into the WHERE clause of database queries.

Due to a PHP type juggling issue after JSON decoding, numeric strings are converted into integers, bypassing an is_int() security check and allowing authenticated attackers to craft malicious filters that alter or exfiltrate data through arbitrary SQL commands.

Affected context

The vulnerability appears in EGroupware's core query-building logic for the Nextmatch component, which processes filter parameters received from authenticated users.

It affects scenarios where:

  • Filter parameters are sent as JSON and decoded in PHP
  • The decoded values are trusted as safe integers based on is_int() checks
  • These values are then interpolated into SQL WHERE clauses without proper parameterization

Deployments where authenticated users can influence complex filters or search criteria are particularly exposed.

Exploit preconditions

  • Attack surface: Application web interface (HTTP/HTTPS endpoints that use Nextmatch-based filtering).
  • Required access: Valid authenticated account with permissions to use views or modules that rely on Nextmatch filters.
  • Trigger point: Submission of crafted filter data (often JSON-encoded) that is decoded and fed into the SQL query builder.
  • Why exploitation is possible:
  • JSON decoding in PHP converts numeric strings into integers.
  • The application uses is_int() as a safety gate, assuming that integers are safe.
  • Attacker-controlled data that passes this check is incorporated into the SQL WHERE clause without proper parameter binding or escaping.
  • This allows injection of conditions or fragments that modify the intended query logic.

Why this happens

The core issue is the combination of:

  • Trusting data solely based on PHP type checks after JSON decoding, and
  • Building SQL statements in a way that allows those values to influence the WHERE clause structure.

When JSON input is decoded, numeric strings become integers, so is_int() returns true even for attacker-controlled content. The code then treats such values as inherently safe and embeds them into SQL fragments instead of using parameterized queries.

This pattern aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where external input is allowed to shape SQL commands rather than being treated strictly as data. The implicit trust in type-based validation, without strict whitelisting and parameterization, creates a path for malicious filters to alter query semantics.

Potential impact

  • Extraction of sensitive data from tables reachable by the affected queries
  • Unauthorized access to other users' information or application metadata
  • Manipulation or deletion of records (e.g., updates, soft deletes, or hard deletes) depending on query context
  • Bypassing of application-level access controls enforced via SQL conditions
  • Lateral movement toward other vulnerabilities through knowledge gained from database contents

General mitigation guidance

Effective mitigation typically focuses on enforcing strict separation between data and SQL logic, and on avoiding reliance on PHP type juggling for security.

Common defensive patterns include:

  • Using parameterized queries or prepared statements for all variable parts of SQL, including dynamically constructed WHERE filters.
  • Replacing generic is_int() checks with explicit whitelisting of allowed values and ranges, or mapping user input to known-safe constants.
  • Normalizing and validating decoded JSON data using strict schemas, ensuring only expected types and formats are accepted.
  • Avoiding concatenation of user-derived values into SQL fragments that can alter query structure (operators, column names, function calls).
  • Designing filter APIs that expose a constrained set of allowed operations, rather than allowing arbitrary filter expressions.

How teams detect issues like this

High-level detection approaches may include:

  • Static analysis:
  • Rules that flag SQL query construction using string concatenation or interpolation with variables derived from request or JSON-decoded data.
  • Checks for reliance on is_int(), is_numeric(), or similar type-based gates immediately before SQL construction.
  • Code review:
  • Reviewing all Nextmatch-related query builders and filter processors for non-parameterized SQL and dynamic WHERE clause construction.
  • Looking for places where JSON-decoded arrays are passed directly into query-building helpers without schema validation.
  • Runtime and policy enforcement:
  • Application firewalls or query firewalls that detect anomalous query patterns or unexpected predicates.
  • CI/CD policies that require use of database abstraction layers or prepared-statement APIs and reject direct concatenation of SQL.

Automated code review and SAST tools can be configured to highlight dynamic SQL construction patterns and insecure type-based validation.

Sources

SourceLink
github.comgithub.com/EGroupware/egroupware/releases/tag/23.1.20260113
github.comgithub.com/EGroupware/egroupware/releases/tag/26.0.20260113
github.comgithub.com/EGroupware/egroupware/security/advisories/GHSA-rvxj-7f72-mhrx

Frequently asked

questions

Yes, it is exploitable over the network through the web interface, but only by authenticated users who can submit data to features that use the Nextmatch filter processing.

The vulnerability requires a valid authenticated account, but not necessarily administrative privileges. The exact impact depends on what data the affected Nextmatch views expose to that user role.

The most robust fix is to ensure all user-influenced values are passed into SQL statements through parameterized queries, combined with strict whitelisting and schema validation for filter parameters, rather than relying on is_int() or other type checks for security.

Establish a development standard that prohibits dynamic SQL assembly from request data, enforces prepared statements across the codebase, treats JSON-decoded data as untrusted until validated against a schema, and includes security-focused code review for all query-building logic.

Find out what's already
exploitable in your codebase.