/

CVE-2026-52348

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in cool-admin-java CrudOption

CVE-2026-52348

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL query manipulation and data compromise

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 SQL injection vulnerability in cool-admin-java 8.0.0 allows attacker-controlled input to be embedded directly into database queries in the CrudOption.order() method.

When untrusted parameters are used to construct ORDER BY or similar clauses without proper validation or parameterization, an attacker can manipulate queries to access or modify data and potentially impact the underlying database server.

Affected context

This vulnerability occurs in applications built with cool-admin-java 8.0.0 that rely on CrudOption.order() to dynamically construct SQL sorting or query fragments.

It typically manifests when user-supplied values (such as sort fields, directions, or filter options) are concatenated into SQL statements without strict whitelisting or parameter binding.

The risk is highest in deployments where the application connects to production databases containing sensitive business or user data and where the database account has broad privileges.

Exploit preconditions

  • Attack surface: HTTP endpoints or API calls that accept query, ordering, or filter parameters and internally call CrudOption.order().
  • Required access: Ability to send crafted requests to affected endpoints; no direct database access is necessary.
  • Trigger point: Execution of SQL statements built using unvalidated input inside the order() method, typically during list, search, or report operations.
  • Why exploitation is possible: The order() method constructs SQL fragments by string concatenation, failing to enforce parameterized queries or strict field whitelisting, enabling attackers to inject additional SQL syntax.

Why this happens

The underlying bug aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

The CrudOption.order() method appears to treat user-controlled values (such as column names or sort direction) as trusted and incorporates them directly into SQL strings.

This insecure pattern—dynamic query construction without parameter binding or canonicalization—allows attacker-provided input to alter the structure of SQL commands rather than being treated as data.

At a design level, the query-building API does not enforce separation between data and control, nor does it provide safe abstractions for ordering operations.

Potential impact

  • Attackers may read data they are not authorized to access by expanding SELECT queries.
  • Malicious queries could modify or delete records, leading to data loss or corruption.
  • SQL injection can be leveraged to create or drop tables and other schema objects if permissions allow.
  • An attacker could escalate privileges or bypass application-level authorization controls.
  • In some environments, database-level features (e.g., stored procedures) may allow limited remote code execution or host-level impact.

General mitigation guidance

Effective mitigation focuses on eliminating direct string concatenation in query construction and reducing trust in dynamic query parameters.

Pattern-based defensive approaches include:

  • Using parameterized queries or ORM query builders that separate data from SQL control structures.
  • Restricting ORDER BY and similar clauses to a predefined whitelist of allowed columns and directions, mapping user input to safe identifiers rather than interpolating raw values.
  • Centralizing query-building logic in secure helper methods that enforce validation and canonicalization of field names.
  • Operating the database with least-privilege credentials so that, even if a query is abused, destructive operations are constrained.
  • Applying defense-in-depth checks such as input normalization and rejecting unexpected SQL meta-characters in context-sensitive parameters.

How teams detect issues like this

Organizations can identify SQL injection patterns through a combination of design review and automated analysis:

  • Static analysis rules that flag dynamic SQL construction, especially concatenation involving request parameters, DTO fields, or other untrusted sources.
  • Code review checklists that require inspection of all query-building methods (including CrudOption.order()) for use of string concatenation and lack of whitelisting.
  • Logging and monitoring of atypical SQL statements, such as queries containing unexpected keywords (UNION, DROP, INSERT) originating from user-facing operations.
  • Secure coding policies that mandate the use of parameterized query APIs or ORM abstractions and forbid direct interpolation of user input into SQL.
  • Optional use of automated application security testing tools (SAST/DAST) to exercise endpoints with crafted payloads and detect injection responses or errors.

Sources

SourceLink
github.comgithub.com/cool-team-official/cool-admin-java/issues/19

Frequently asked

questions

The vulnerability can be exploited anywhere CrudOption.order() is exposed through endpoints that accept user-controlled ordering or filtering parameters.

If those endpoints are publicly accessible, the attack surface extends to any remote user able to send crafted HTTP requests.

The attacker only needs the ability to invoke affected application routes—typically standard web or API access.

No database credentials or local server access are required, as the application performs the queries on the attacker's behalf.

Refactor query construction to use parameterized queries or ORM abstractions and remove any direct string concatenation of user input.

For ordering and similar controls, implement strict whitelisting of valid column names and directions and map user input to safe, predefined values.

Adopt secure coding standards that prohibit dynamic SQL construction with raw user input and enforce the use of safe query-building APIs.

Combine these standards with routine code reviews, static analysis, and design-time validation of query-related components to catch injection patterns before deployment.

Find out what's already
exploitable in your codebase.