ci: validate release version and harden workflow against input injection by mcollina · Pull Request #2530 · pinojs/pino · GitHub
Skip to content

ci: validate release version and harden workflow against input injection - #2530

Open
mcollina wants to merge 1 commit into
mainfrom
hardening/publish-release-version
Open

mcollina wants to merge 1 commit into
mainfrom
hardening/publish-release-version

Conversation

@mcollina

@mcollina mcollina commented Oct 6, 2026

Copy link
Copy Markdown
Member

Hardens the release workflow against command/string injection from the workflow_dispatch version input (GHSA-749g-253p-pqxv). We assessed that advisory as not a security vulnerability because triggering the workflow already requires write access and the main environment enforces required reviewers, but the underlying interpolations are worth fixing as defense in depth.

  • Validate the version input against a semver pattern before any step runs.
  • Pass version, github.ref, and GITHUB_TOKEN to run steps via env with quoted expansion instead of unquoted inline interpolation.
  • In build/sync-version.js, serialize the version into lib/meta.js with JSON.stringify so a crafted value cannot break out of the generated string literal.

Verified the semver check accepts valid versions (including v-prefixed and prerelease) and rejects injection payloads, the meta.js generator safely quotes a malicious payload instead of executing it, and node test/internals/version.test.js still passes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant