Skip to content

Trusted Publishing downgrade #43

Closed

Description

@slorber

Hi

v3 has recently been published with Trusted Publishing

v2.0.2 was published afterward wothout Trusted Publishing

CleanShot 2026-11-12 at 12 22 03@2x

In theory this is not a big deal, but in practice many pnpm users may get a "trust downgrade" alert:

Error:   × installing dependencies
  ╰─▶ Failed to resolve dependency tree: Failed to resolve dependency: High-
      risk trust downgrade for "encodeurl@2.0.2" (possible package takeover)

https://pnpm.io/settings/dependency-resolution#trustpolicy

This happens when users opt-in for the trustPolicy: no-downgrade option.

Of course, we could use pnpm trustPolicyExclude: ['encodeurl@2.0.2'] option to mitigate this problem.


What to do about it?

I'll let you decide what's best for this project, but my suggestion to avoid your consumers to get this pnpm warning is to publish v1.x and v2.x patches with Trusted Publishing too.

Among the 200m+ weekly downloads of v1/v2 for this package, many users will likely use pnpm with its strictest security options like me, will encounter this error and will need to configure an exclusion after taking time to understand the problem and assessing if it's a legit publish downgrade or a possible supply chain attack. Moving every major versions to Trusted Publishing is not strictly required, but would save time for many of us.


How this was caugnt?

Our CI uses sfw + pnpm with a strict security config to scan for downgrades and risky transitive dependencies in our dependency graph, for newly publishes that match our semver ranges.

This workflow run flagged the new v2.0.2 publish as possibly unsafe and worth revewing:
https://github.com/meta/docusaurus/actions/runs/43207024192/job/131144672546?pr=12945

Activity

  1. UlisesGascon commented on Nov 12, 2026

    @UlisesGascon
    Member

    Having something like expressjs/body-parser#768 might help to cover this gap

  2. blakeembrey commented on Nov 12, 2026

    @blakeembrey
    Member

    That's unfortunate but I don't think it's super urgent. I would have hoped a policy like this would be based on semver. I'll look at extracting something into a common action helper across all the repos, so it might take a little while. Then I need to port it into each of the branches and do a new release on each branch.

  3. blakeembrey commented on Nov 12, 2026

    @blakeembrey
    Member

    Backported into both release branches and re-released, this should be fixed now.

    CleanShot 2026-11-12 at 10 20 17@2x
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions