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
nodeParamsargument (authentication requirements depend on deployment configuration) - Trigger point: Server-side invocation of
GroovyEvaluator.evaluateduring 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
nodeParamsas structured data (e.g., JSON with whitelisted fields and types). - Replacing generic
evaluateusage 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
nodeParamsto 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 (likeGroovyEvaluator.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
nodeParamssources 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
nodeParamsfield. - Monitoring for anomalous process behavior on the PowerJob host (unexpected outbound connections, file modifications, or command execution originating from the application process).

