/

CVE-2026-72565

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in Tencent APIJSON @having Operator

CVE-2026-72565

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized Database Access and Confidentiality Loss

Severity:

CRITICAL RISK

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

A critical SQL injection vulnerability in Tencent APIJSON through version 8.1.8 affects processing of the Map-form @having operator. An unauthenticated remote attacker may bypass per-table access controls and read arbitrary database tables when a vulnerable endpoint accepts attacker-controlled query parameters.

Affected context

The issue may arise in APIJSON deployments that expose query functionality through remotely reachable API endpoints and process the Map-form @having operator without sufficiently separating user-supplied values from SQL expressions. Risk is higher when endpoints are unauthenticated or when database authorization relies primarily on application-level per-table access controls.

Exploit preconditions

  • Attack surface: Remotely accessible APIJSON query endpoints
  • Required access: No authentication may be required when an affected endpoint is publicly reachable
  • Trigger point: Processing of attacker-controlled input associated with the Map-form @having operator
  • Why exploitation is possible: Insufficient separation between query input and generated SQL may allow user-controlled expressions to alter database query behavior and bypass application-level table restrictions

Why this happens

The underlying bug is an SQL injection condition, mapped to CWE-89, in which externally controlled query data is incorporated into SQL processing without reliable parameterization or equivalent structural controls. When the Map-form @having operator is interpreted as part of a database query, inadequate validation or query construction boundaries may allow input to influence SQL semantics rather than remain a constrained data value.

Potential impact

  • An attacker may bypass per-table access controls
  • An attacker could read arbitrary database tables
  • Sensitive business, personal, or authentication data may be disclosed
  • Database confidentiality and application trust boundaries may be weakened
  • Excessive database permissions could increase the scope of resulting data exposure

General mitigation guidance

Mitigation generally focuses on ensuring that query construction treats external input as data rather than executable SQL structure.

Common defensive patterns include:

  • Using parameterized queries or safe query-builder abstractions for values
  • Allowing only explicitly supported operators, fields, and query shapes
  • Applying strict type, format, and allowlist validation to Map-form query inputs
  • Enforcing authorization after query interpretation and independently of client-supplied table or field selectors
  • Using database identities with least-privilege read permissions and narrowly scoped table access
  • Limiting unauthenticated access to query endpoints and applying appropriate request controls
  • Avoiding dynamic SQL fragments unless they are generated exclusively from trusted, validated identifiers

How teams detect issues like this

Detection approaches may include:

  • Static analysis for string concatenation or interpolation involving request parameters and SQL statements
  • Code review of custom handling for @having, table selectors, field selectors, and other query operators
  • Testing that unauthorized table references and unsupported query structures are rejected consistently
  • Monitoring database audit logs for unusual table access from API service identities
  • Enforcing policies that require parameterized queries, approved query builders, and explicit operator allowlists
  • Using automated security review tools as a supplementary way to identify SQL construction patterns

Sources

SourceLink
github.comgithub.com/Tencent/APIJSON
github.comgithub.com/Tencent/APIJSON/blob/master/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java

Frequently asked

questions

It may be remotely exploitable when a vulnerable APIJSON query endpoint is reachable over a network and accepts the affected operator. The reported behavior does not require a local foothold.

The described issue allows unauthenticated remote exploitation when the relevant endpoint is exposed without an authentication requirement. Deployment-specific access controls may change that scope.

Treat query operators and values as structured, untrusted input. Use parameterized database access, strict allowlists, and authorization checks that cannot be overridden by client-controlled query fields.

Combine secure query-construction patterns with least-privilege database accounts, endpoint authentication where appropriate, focused authorization tests, and monitoring for unexpected data-access patterns.

Find out what's already
exploitable in your codebase.