/

CVE-2026-41414

Severity:

HIGH RISK

(7.4)

Code Injection / Untrusted CI Execution in Skim GitHub

CVE-2026-41414

Analyzed

Vulnerability type

Category:

Code Injection / Untrusted CI Execution

CWE:

CWE-94

Impact:

Arbitrary Code Execution in CI and Credential Abuse

Severity:

HIGH RISK

(7.4)

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

The Skim project's generate-files GitHub Actions workflow executed attacker-controlled fork code via cargo run while exposing sensitive secrets such as SKIM_RS_BOT_PRIVATE_KEY and a GITHUB_TOKEN with write access.

Any GitHub user able to open a pull request from a fork could abuse this workflow to run arbitrary code in the CI environment and misuse the exposed credentials.

Affected context

This vulnerability appears in the Skim repository's GitHub Actions configuration, specifically the generate-files job defined in .github/workflows/pr.yml.

The workflow checks out code from pull requests originating from forks and then runs cargo run, effectively delegating execution control to the fork's code.

At the same time, the job exposes powerful secrets (SKIM_RS_BOT_PRIVATE_KEY and a GITHUB_TOKEN with contents:write), creating a high-risk intersection of untrusted code and privileged credentials.

Exploit preconditions

  • Attack surface: GitHub Actions CI pipeline for pull requests
  • Required access: Ability to create a fork of the Skim repository and open a pull request (available to any GitHub user)
  • Trigger point: Opening a PR from a fork that modifies the code path executed by cargo run in the generate-files job
  • Why exploitation is possible:
  • The workflow runs cargo run on untrusted fork code during PR CI
  • The same job exposes sensitive secrets (SKIM_RS_BOT_PRIVATE_KEY, GITHUB_TOKEN with contents:write)
  • No conditional gates or trust checks restrict secret exposure for fork-based pull requests

Why this happens

The underlying issue is a CI configuration pattern where untrusted, contributor-supplied code is executed with access to highly privileged secrets.

This maps to CWE-94: Improper Control of Generation of Code ('Code Injection'), because the workflow effectively lets external parties define the code that runs in a privileged context.

Rather than treating forked pull request code as untrusted and isolating it from sensitive credentials, the pipeline assumes trust and directly invokes cargo run, allowing arbitrary execution within the CI runner and potential exfiltration or misuse of secrets.

Potential impact

  • Unauthorized use of GITHUB_TOKEN to push commits, alter repository contents, or tamper with history
  • Abuse of SKIM_RS_BOT_PRIVATE_KEY to impersonate automated accounts or sign malicious artifacts
  • Injection of backdoors or malicious changes into the repository's codebase or generated files
  • Compromise of release or automation pipelines that rely on the exposed credentials
  • Persistent supply-chain risks if attacker-controlled changes are merged or trusted keys are reused elsewhere

General mitigation guidance

Effective mitigation focuses on separating untrusted contributions from privileged CI execution and secrets:

  • Restrict sensitive secrets so they are not available to workflows triggered by pull requests from forks, or use explicit allowlists for trusted branches.
  • Avoid running arbitrary project code (cargo run, test harnesses with side effects, etc.) in jobs that expose long-lived or high-privilege credentials.
  • Introduce approval or gating mechanisms for workflows that need elevated permissions, such as manual approvals or required checks before secret-enabled jobs run.
  • Apply least-privilege to CI tokens by reducing scopes (e.g., limiting contents:write where possible) and scoping keys to specific tasks.
  • Use separate, low-privilege workflows for PR validation and reserve high-privilege workflows for post-merge or internal-only operations.

How teams detect issues like this

Organizations can detect similar vulnerabilities through a combination of configuration review and policy enforcement:

  • Static analysis or policy-as-code tools inspecting CI configurations (e.g., GitHub Actions YAML) for patterns where:
  • Secrets are exposed on pull_request or fork-based triggers
  • Untrusted code paths are executed (run: cargo run, generic script runners) in the same job that uses privileged secrets
  • Manual or assisted code review focusing on:
  • Workflows that run on external contribution triggers
  • Jobs that combine checkout of fork code with secret usage
  • CI governance rules that:
  • Prohibit secrets in workflows triggered by untrusted actors
  • Require approvals or additional checks before running privileged jobs
  • Periodic audits of token scopes and key usage, ensuring secret distribution aligns with trust boundaries in the CI system.

Sources

SourceLink
github.comgithub.com/skim-rs/skim/commit/bf63404ad51985b00ed304690ba9d477860a5a75
github.comgithub.com/skim-rs/skim/security/advisories/GHSA-9g93-rxr5-xhqw
drive.google.comdrive.google.com/file/d/1Gj7ziTK42YWXYoQgTbis_rMitHR59J6F/view

Frequently asked

questions

Any GitHub user capable of forking the repository and opening a pull request could trigger the vulnerable workflow, making the exposure global rather than limited to existing contributors.

The attacker only needs standard GitHub access to create a fork and submit a PR; no special permissions, authentication beyond a regular GitHub account, or prior access to the project is required.

The safest pattern is to ensure that workflows triggered by untrusted events (like fork-based pull requests) do not run with privileged secrets and do not execute arbitrary project code that can be controlled by external contributors. High-privilege operations should be confined to trusted branches and gated workflows.

Projects can establish CI security guidelines that treat all external contributions as untrusted by default, restrict secrets from PR workflows, apply least-privilege token scopes, regularly review workflow files, and use automated checks to flag workflows that mix untrusted code execution with secret usage.

Find out what's already
exploitable in your codebase.