feat: run unsafe executions (allowedUnsafeExecutions) like mise lock without exposing write token
#43823
idelsink
started this conversation in
Suggest an Idea
Replies: 2 comments 5 replies
-
|
@idelsink please don't tag users/maintainers in your Discussions. It adds unnecessary noise and spams their notifications. Also, if you're using AI to contribute to Discussions, please make sure you disclose it. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
More generally:
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Tell us more.
When
allowedUnsafeExecutions: ['mise']is enabled,lib/modules/manager/mise/artifacts.tsresolves the host's GitHub token viafindGithubTokenand passes it directly asGITHUB_TOKENto themise trust+mise locksubprocess:This token typically has write access (push branches, create PRs). A malicious
mise.tomlcustom backend could execute arbitrary code duringmise lockand exfiltrate it, which is the exact supply chain attackallowedUnsafeExecutionswas meant to guard against.It was flagged in #43606:
As a real-world example: my self-hosted runner (
idelsink/renovate-runner) runs Renovate inside Docker with a scoped GitHub App token that has write permissions (workflow L128–139), injected asRENOVATE_TOKEN(workflow L207–218). The Docker container and ephemeral token limit blast radius, but the write token is still unnecessarily exposed duringmise lock, which only needs read access to resolve checksums from GitHub releases.Proposed solution
Split unsafe execution into two stages with different token scopes:
mise trust+mise lockwith a read-only token (or no token). Resolving checksums only requires read access to GitHub releases.mise.lockchanges using the write token via the normal Renovate update flow.An optional
unsafeExecutionTokenhostRule (or self-hosted config key) could provide a lower-privilege token specifically forextraEnv.GITHUB_TOKENduring unsafe executions, falling back to current behaviour if not configured. This would generalise to futureallowedUnsafeExecutionsmanagers (e.g.goGeneratefrom #39163).There is currently no workaround within Renovate's architecture. Docker isolation and ephemeral repo-scoped tokens are the only available mitigations.
Beta Was this translation helpful? Give feedback.
All reactions