Skip to content

pnpm publish provenance from GitLab CI is rejected by npm (422): invocation.parameters missing from the SLSA v0.2 predicate #16551

Closed

Description

@chez14

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

12.8.1

Which area(s) of pnpm are affected? (leave empty if unsure)

CLI

Link to the code that reproduces this issue or a replay of the bug

Reproduction steps

  1. Set up npm trusted publishing for a GitLab CI/CD project on npmjs.com.
  2. Use a GitLab CI job like this one. The image is public and ships Node.js and pnpm. Any image works if pnpm is installed with curl -fsSL https://get.pnpm.io/install.sh | sh -.
    publish:
      image: registry.gitlab.com/net.christianto/images/node-testing:24-alpine
      id_tokens:
        NPM_ID_TOKEN:
          aud: "npm:registry.npmjs.org"
        SIGSTORE_ID_TOKEN:
          aud: sigstore
      script:
        - pnpm install --frozen-lockfile
        - pnpm -r publish --no-git-checks --registry https://registry.npmjs.org/
  3. Run the job on a protected branch.

pnpm prints Signed provenance statement with source and build information, then the upload fails:

ðŸ“Ķ @net.christianto/emvco-mpm@0.0.2 → https://registry.npmjs.org/
Signed provenance statement with source and build information
Error: ERR_PNPM_FAILED_TO_PUBLISH

  × Failed to publish package @net.christianto/emvco-mpm@0.0.2 (status 422
  │ Unprocessable Entity): {"success":false,"error":"Error verifying sigstore
  │ provenance bundle: Invalid GitLab CI SLSA v0.2 provenance predicate:
  │ \ninvocation.parameters.CI_PROJECT_URL: <empty> does not match expected
  │ value for SourceRepositoryURI: https://gitlab.com/net.christianto/deps/
  │ qris-kit,\ninvocation.parameters.CI_COMMIT_SHA: <empty> does not match
  │ expected value for SourceRepositoryDigest:
  │ 9f19746ab776fbf547707911ab98968091c9fcb7,
  │ \ninvocation.parameters.CI_PROJECT_ID: <empty> does not match expected
  │ value for SourceRepositoryIdentifier: 83865880,
  │ \ninvocation.parameters.CI_PROJECT_NAMESPACE_ID: <empty> does not match
  │ expected value for SourceRepositoryOwnerIdentifier: 66382978,
  │ \ninvocation.parameters.CI_PIPELINE_SOURCE: <empty> does not match
  │ expected value for BuildTrigger: push"}

Describe the Bug

gitlab_statement() in pnpm/crates/publish/src/provenance_gen.rs builds predicate.invocation with only configSource and environment. It never writes invocation.parameters.

The npm registry checks the GitLab predicate's invocation.parameters.* against the Fulcio certificate claims (CI_PROJECT_URL ↔ SourceRepositoryURI, CI_COMMIT_SHA ↔ SourceRepositoryDigest, CI_PROJECT_ID, CI_PROJECT_NAMESPACE_ID, CI_PIPELINE_SOURCE, â€Ķ). The block is missing, so every field reads as <empty> and the publish fails. The variables are set in the job; pnpm just doesn't put them in the statement.

npm's implementation, which this code appears to port, includes the block: libnpmpublish/lib/provenance.js copies a fixed list of GitLab CI variables (CI, CI_API_V4_URL, â€Ķ, CI_PROJECT_URL, CI_COMMIT_SHA, CI_PIPELINE_SOURCE, GITLAB_USER_LOGIN, â€Ķ) into invocation.parameters.

The GitHub Actions statement (SLSA v1) uses a different shape and doesn't seem affected.


Expected Behavior

The GitLab provenance statement includes predicate.invocation.parameters with the same GitLab CI variables npm's libnpmpublish emits, so the registry accepts the publish with provenance like npm publish does from the same job.


Which Node.js version are you using?

24.21.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

Alpine Linux (registry.gitlab.com/net.christianto/images/node-testing:24-alpine, GitLab.com SaaS runner, linux-x64-musl)

Contributing a fix

  • I am working on a fix

Note

LLM notice: This issue was investigated and drafted with the help of an LLM. I, the author, have reviewed the analysis, the linked source code, and the job log, and confirmed the content before submitting.

Activity

  1. added
    area: supply chain securityIssues related to minimumReleaseAge, blockExoticSubdeps, build script safety, and trust policies.
    on Oct 3, 2026
  2. chez14 commented on Oct 3, 2026

    @chez14
    Author

    Uhhh... I got notification that CI/CD Error when opening this issue btw: https://github.com/pnpm/pnpm/actions/runs/37121069180

    Just in case anyone interested.

  3. added a commit that references this issue on Oct 3, 2026
    10e6d06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: supply chain securityIssues related to minimumReleaseAge, blockExoticSubdeps, build script safety, and trust policies.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions