Summary
A command injection vulnerability in Renovate's Gradle Wrapper manager allows a crafted distributionUrl in a repository's Gradle wrapper properties to influence command execution. The issue becomes risky in self-hosted deployments that use Docker as the binary source and permit Gradle Wrapper executions, potentially allowing arbitrary commands to run with Renovate's privileges.
Affected context
The vulnerability occurs in self-hosted Renovate deployments when the Gradle Wrapper manager reads a repository-controlled distributionUrl from gradle/wrapper/gradle-wrapper.properties and passes it to the Gradle Wrapper CLI without sufficient escaping. Exploitation depends on Docker-based binary execution being enabled and the deployment allowing the gradleWrapper unsafe execution type.
Exploit preconditions
- Attack surface: Repository-provided Gradle Wrapper configuration processed by Renovate
- Required access: Ability to submit or modify a repository that Renovate monitors
- Deployment requirement: A self-hosted deployment configured with
binarySource=docker - Policy requirement:
gradleWrappermust be present inallowedUnsafeExecutions - Trigger point: Processing a Gradle Wrapper update
- Why exploitation is possible: The
distributionUrlvalue is not safely escaped before being used in a command-execution context
Why this happens
The underlying bug is an OS command injection caused by treating repository-controlled data as a command argument without applying context-appropriate escaping or strict validation. Shell metacharacters embedded in the Gradle distributionUrl can alter command interpretation when the value reaches the Gradle Wrapper execution path. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, where untrusted input can affect the structure or meaning of an operating-system command.
Potential impact
- Arbitrary commands may execute with the Renovate service user's privileges
- The Renovate worker or container could be compromised
- Repository credentials, tokens, or accessible secrets could be exposed
- Attackers could alter generated updates or automation results
- The host or connected services could face further compromise, depending on isolation and permissions
General mitigation guidance
Mitigation generally focuses on removing shell interpretation from data-driven execution paths and reducing trust in repository-controlled configuration.
Common defensive patterns include:
- Pass validated values as structured process arguments rather than constructing shell command strings
- Apply strict allowlisting and canonical validation to wrapper distribution URLs
- Treat repository configuration as untrusted input, even when processed by automation
- Disable unsafe Gradle Wrapper execution capabilities unless they are explicitly required
- Run Renovate with a dedicated low-privilege identity and strong container isolation
- Limit mounted credentials, network access, filesystem access, and container capabilities
- Use read-only or ephemeral execution environments where practical
How teams detect issues like this
Organizations can look for:
- Static analysis findings involving shell execution, string concatenation, or interpolation of repository-controlled values
- Code review signals where URLs or configuration fields are passed to command runners without structured argument handling
- Policy checks that flag broad unsafe-execution allowlists or unrestricted Gradle Wrapper processing
- Runtime monitoring for unexpected child processes, shell interpreters, outbound connections, or file changes from Renovate workers
- Audit records correlating Gradle Wrapper update jobs with unusual command activity
Automated code review and software composition analysis tools may help identify unsafe command construction patterns, but should be complemented by deployment-level controls.

