Severity:

HIGH RISK

(7.3)

Code Injection in PowerJob OpenAPI /addWorkflowNode

CVE-2026-5739

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-74, CWE-94

Impact:

Remote Code Execution

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 exposes a code injection flaw in the OpenAPI endpoint /openApi/addWorkflowNode, where user-controlled nodeParams are evaluated by GroovyEvaluator.evaluate.

A remote attacker who can call this endpoint may execute arbitrary code on the server by injecting malicious Groovy expressions into the affected parameter.

Affected context

The vulnerability appears in PowerJob deployments that expose the OpenAPI endpoint /openApi/addWorkflowNode and accept nodeParams from external clients.

The issue manifests when the server passes this parameter into GroovyEvaluator.evaluate without strict validation, sandboxing, or restriction of executable constructs.

Environments that integrate automation, scheduling, or workflow orchestration via this API are particularly exposed if the endpoint is reachable from untrusted networks or multi-tenant clients.

Exploit preconditions

  • Attack surface: HTTP(S) OpenAPI endpoint /openApi/addWorkflowNode
  • Required access: Ability to send requests that control or influence the nodeParams argument (authentication requirements depend on deployment configuration)
  • Trigger point: Server-side invocation of GroovyEvaluator.evaluate during creation or update of a workflow node
  • Why exploitation is possible: The server evaluates attacker-supplied data as Groovy code, enabling execution of arbitrary expressions or method calls under the server's runtime permissions

Why this happens

The root cause is the execution of untrusted input as code within the Groovy engine.

The nodeParams parameter, originating from an HTTP request, is treated as a Groovy expression or script and passed into GroovyEvaluator.evaluate without adequate restriction.

This aligns with CWE-94: Improper Control of Generation of Code, where user data is incorporated into executable code, and with elements of CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, since user-controlled constructs are propagated into a downstream interpreter (Groovy) without proper neutralization.

Conceptually, the application collapses the trust boundary between configuration data and executable logic, allowing an attacker to smuggle code through what should be a data-only channel.

Potential impact

  • Remote execution of arbitrary Groovy code on the PowerJob server
  • Reading, modifying, or deleting application and workflow configuration data
  • Accessing sensitive information available to the application (e.g., credentials, environment variables, job payloads)
  • Lateral movement within the hosting environment or network, depending on server privileges
  • Complete compromise of the scheduling or orchestration environment, including job tampering and backdoored workflows

General mitigation guidance

Mitigation typically focuses on separating data from executable code and constraining dynamic evaluation.

Recommended defensive patterns include:

  • Avoiding direct evaluation of client-supplied strings as Groovy code; instead, treat nodeParams as structured data (e.g., JSON with whitelisted fields and types).
  • Replacing generic evaluate usage with explicit, parameterized logic paths that do not depend on runtime code generation.
  • If dynamic Groovy evaluation is truly required, employing a hardened sandbox:
  • Disable or restrict access to dangerous classes, reflection, and IO/OS APIs.
  • Enforce allowlists of permitted methods, packages, and language constructs.
  • Enforcing strong validation on nodeParams to ensure it matches a strict schema and cannot carry arbitrary expressions.
  • Running the PowerJob service with least privilege at the OS and network level to reduce blast radius if code execution occurs.

How teams detect issues like this

Detection can focus on both code-level patterns and runtime behavior.

Code-level & pipeline detection:

  • Static analysis rules that flag usage of GroovyShell, GroovyScriptEngine, or custom evaluators (like GroovyEvaluator.evaluate) when fed with request-derived data.
  • Code review checklists that highlight any dynamic execution constructs, requiring explicit justification and threat modeling.
  • CI/CD policies that block or require approval for changes introducing new code evaluation paths or reflection-heavy Groovy usage.

Runtime & operational detection:

  • Application logging of nodeParams sources and abnormal patterns (e.g., unexpected method calls, imports, or system access keywords) with alerting for suspicious payloads.
  • Web application firewall (WAF) or API gateway rules to detect and optionally block likely Groovy injection patterns in the nodeParams field.
  • Monitoring for anomalous process behavior on the PowerJob host (unexpected outbound connections, file modifications, or command execution originating from the application process).

Sources

SourceLink
github.comgithub.com/PowerJob/PowerJob/
github.comgithub.com/PowerJob/PowerJob/issues/1168
vuldb.comvuldb.com/submit/786936
vuldb.comvuldb.com/vuln/355747
vuldb.comvuldb.com/vuln/355747/cti

Frequently asked

questions

Yes, the flaw resides in a remotely accessible OpenAPI endpoint. If the endpoint is exposed to untrusted clients and they can control nodeParams, they may be able to trigger code execution.

That depends on the deployment. If /openApi/addWorkflowNode requires authentication or specific roles, an attacker would first need those credentials or to compromise a user with access. However, if the endpoint is misconfigured as publicly accessible, anonymous exploitation becomes more feasible.

The most robust fix is to eliminate dynamic evaluation of client-provided input entirely. Replace GroovyEvaluator.evaluate on untrusted data with deterministic, parameterized logic or a constrained configuration format where all operations are predefined and data-driven rather than code-driven.

Design APIs so that external inputs are always treated as data, never as code. Enforce strict schemas, avoid generic eval-style functions, mandate security review for any dynamic execution features, and integrate static analysis and policy checks into CI to block dangerous evaluation patterns before they reach production.

Find out what's already
exploitable in your codebase.