Severity:

HIGH RISK

(7.3)

SQL Injection in PowerJob detailPlus Endpoint

CVE-2026-5736

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Data Exposure and Manipulation via SQL Injection

Severity:

HIGH RISK

(7.3)

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

PowerJob 5.1.0–5.1.2 contains a SQL injection vulnerability in the detailPlus endpoint of InstanceController, where the customQuery request parameter is incorporated into database queries without sufficient sanitization.

A remote attacker can craft malicious customQuery input to manipulate SQL statements, potentially accessing or modifying job instance data and other records managed by the PowerJob server.

Affected context

The vulnerability occurs in the detailPlus endpoint of the PowerJob server's InstanceController class.

It affects deployments where:

  • The PowerJob server is reachable over the network (e.g., exposed to internal or external clients).
  • The detailPlus endpoint is enabled and processes the customQuery argument.
  • Input from HTTP requests is passed to database queries without robust parameterization or filtering.

Risk increases when the same database holds sensitive configuration, tenant, or scheduling metadata beyond basic job instance details.

Exploit preconditions

  • Attack surface: HTTP interface of the PowerJob server, specifically the detailPlus endpoint.
  • Required access: Ability to send requests to the PowerJob server (network access to the management API; authentication requirements depend on deployment configuration).
  • Trigger point: Submission of a crafted customQuery value that is incorporated into a SQL statement executed by the backend.
  • Why exploitation is possible: The implementation appears to concatenate the customQuery parameter directly into SQL or a query builder without using strictly parameterized queries or proper escaping, enabling user-controlled alteration of the query structure.

Why this happens

This issue stems from improper neutralization of user-supplied input before it is included in SQL statements, aligning with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

The customQuery parameter is likely treated as trusted and interpolated into a query string or dynamic condition, allowing attackers to inject control characters, operators, or additional clauses (e.g., logical conditions, unions, or subqueries).

Conceptually, the bug is an insecure pattern where application logic exposes flexible query functionality to clients without enforcing strict query templates, parameter binding, or a constrained query syntax, thereby blurring the boundary between data and code within the database interaction.

Potential impact

  • Attackers may read data they are not intended to see, including job instances, logs, or tenant-related metadata.
  • Malicious users could modify or delete records, impacting scheduled jobs, execution history, or operational data.
  • SQL injection payloads can potentially be used to bypass logical access controls implemented at the application layer.
  • Under certain database and permission configurations, attackers might escalate to broader database compromise, including alteration of configuration tables or creation of backdoor accounts.
  • Indirect disruption of job scheduling or execution reliability by corrupting or poisoning stored state.

General mitigation guidance

Effective mitigation focuses on eliminating direct concatenation of user input into SQL and strictly limiting the expressiveness of client-controlled query parameters.

Recommended defensive patterns include:

  • Using prepared statements with parameterized queries for all variable parts of SQL, ensuring that customQuery-derived values are bound as data, not code.
  • Refactoring the detailPlus functionality to expose only a predefined set of filter fields and operators rather than arbitrary query fragments.
  • Implementing a strict whitelist-based query builder that parses incoming filter criteria into a constrained, validated structure before translating it into SQL.
  • Applying centralized input validation and canonicalization for any field that influences query construction, rejecting malformed or overly complex expressions.
  • Ensuring the database account used by the PowerJob server follows least privilege, limiting the impact of any successful injection attempt.
  • Considering query timeouts, row limits, and defensive database configuration to reduce the impact of expensive or destructive queries.

How teams detect issues like this

Detection efforts can focus on both code-level analysis and runtime monitoring:

  • Static analysis: Configure SAST tools or custom rules to flag string concatenation or formatting operations used to build SQL, especially around controllers or service methods handling customQuery or similar parameters.
  • Code review: During manual review, look for endpoints that offer advanced or "flexible" search capabilities; verify that they rely on parameterized queries or a safe query DSL rather than raw fragments.
  • Unit and integration tests: Add negative tests that include typical SQL injection tokens (', ", --, ;, /* */, logical operators) in customQuery values and verify that the resulting SQL does not change structure.
  • Runtime monitoring: Use database query logging or an application firewall to detect anomalous queries containing unexpected concatenated user input, multiple statements, or always-true conditions.
  • Policy enforcement: Enforce internal coding standards that disallow raw string-based query construction in new code and require any dynamic query functionality to go through vetted builder utilities.

Sources

SourceLink
github.comgithub.com/PowerJob/PowerJob/
github.comgithub.com/PowerJob/PowerJob/issues/1167
github.comgithub.com/PowerJob/PowerJob/pull/1166
vuldb.comvuldb.com/submit/786727
vuldb.comvuldb.com/vuln/355746
vuldb.comvuldb.com/vuln/355746/cti

Frequently asked

questions

Exploitability depends on where the PowerJob server is exposed. If the detailPlus endpoint is reachable from untrusted networks or multi-tenant users, a wide range of attackers could attempt SQL injection by crafting customQuery values.

That depends on how authentication and authorization are configured around the detailPlus endpoint. If it is behind login or network controls, an attacker generally needs access equivalent to any user allowed to call that endpoint; if it is exposed without strong access control, anonymous exploitation may be possible.

Replace any SQL construction that interpolates customQuery with parameterized queries or a safe query builder, limit client input to predefined filter fields and operators, and ensure the database user has only the minimal privileges required.

Adopt a development guideline that bans raw string concatenation for database queries, introduce reusable, parameterized data access layers, enforce static analysis checks in CI, and explicitly design any "custom query" features around a constrained, validated query language or builder API.

Find out what's already
exploitable in your codebase.