Skip to content

ci: route release version input through env, not shell interpolation - #11857

Merged
sjrl merged 1 commit into
deepset-ai:mainfrom
camgrimsec:fix-release-shell-injection
Jul 3, 2026
Merged

ci: route release version input through env, not shell interpolation#11857
sjrl merged 1 commit into
deepset-ai:mainfrom
camgrimsec:fix-release-shell-injection

Conversation

@camgrimsec

Copy link
Copy Markdown
Contributor

The parse-validate-version step in release.yml passes the workflow_dispatch version input to a bash script by interpolating the expression directly into the shell command:

run: .github/utils/parse_validate_version.sh "${{ inputs.version }}"

At runtime the runner expands the expression before /bin/bash parses the line, so the raw contents of the input become part of the shell source of the step. If a triggering actor supplies a version string containing a backtick, dollar-parenthesis, or quote-escape sequence, that content is evaluated by the shell before it ever reaches the script.

The release workflow is guarded by an authorize job that requires the triggering actor to hold the maintain or admin role, so the practical risk today is limited: only trusted maintainers can reach this step. This change is defence in depth. It brings the step in line with the pattern used in the later bump-dc-pipeline-templates job (line 280 in the same file already sets VERSION via env), matches the guidance in GitHub's Security hardening for GitHub Actions documentation, and removes one more instance of the anti-pattern the ecosystem has been scrubbing since CVE-2025-30066.

Same class of hardening as #11733 (persist-credentials: false) and #11777 (dependency pinning + CodeQL).

Related Issues

  • fixes #issue-number

Proposed Changes:

How did you test it?

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

The parse-validate-version step in release.yml passes the
workflow_dispatch version input to a bash script by interpolating the
expression directly into the shell command:

  run: .github/utils/parse_validate_version.sh "${{ inputs.version }}"

At runtime the runner expands the expression before /bin/bash parses the
line, so the raw contents of the input become part of the shell source
of the step. If a triggering actor supplies a version string containing
a backtick, dollar-parenthesis, or quote-escape sequence, that content
is evaluated by the shell before it ever reaches the script.

The release workflow is guarded by an authorize job that requires the
triggering actor to hold the maintain or admin role, so the practical
risk today is limited: only trusted maintainers can reach this step.
This change is defence in depth. It brings the step in line with the
pattern used in the later bump-dc-pipeline-templates job (line 280 in
the same file already sets VERSION via env), matches the guidance in
GitHub's Security hardening for GitHub Actions documentation, and
removes one more instance of the anti-pattern the ecosystem has been
scrubbing since CVE-2025-30066.

Same class of hardening as deepset-ai#11733 (persist-credentials: false) and
deepset-ai#11777 (dependency pinning + CodeQL).
@camgrimsec
camgrimsec requested a review from a team as a code owner July 3, 2026 04:14
@camgrimsec
camgrimsec requested review from sjrl and removed request for a team July 3, 2026 04:14
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

@camgrimsec is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@sjrl
sjrl merged commit a8a6495 into deepset-ai:main Jul 3, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants