Skip to content

Use up-to-date github actions#1917

Merged
wraithgar merged 1 commit intonpm:mainfrom
SuperSandro2000:patch-1
Mar 17, 2026
Merged

Use up-to-date github actions#1917
wraithgar merged 1 commit intonpm:mainfrom
SuperSandro2000:patch-1

Conversation

@SuperSandro2000
Copy link
Copy Markdown
Contributor

People should not need to immediately update those again after setting them up.

References

@SuperSandro2000 SuperSandro2000 requested review from a team and leobalter as code owners March 17, 2026 00:33
@wraithgar wraithgar merged commit 6c46b94 into npm:main Mar 17, 2026
8 of 9 checks passed
generalmimon added a commit to generalmimon/npm-documentation that referenced this pull request Apr 8, 2026
The PR npm#1917 bumped the
`actions/setup-node` action from v4 to v6. This made the publishing
GitHub Actions sample workflows potentially vulnerable to cache
poisoning, because v5 and later enable caching by default (see
https://github.com/actions/setup-node/blob/53b83947a5a98c8d113130e565377fae1a50d02f/README.md#breaking-changes-in-v5).
v6 only enables automatic caching if the `packageManager` field in
package.json is set to `npm`.

Consuming GitHub Actions cache in publishing workflows is discouraged,
because the cache may be poisoned by compromising any low-privileged
workflow in the same repository. Normally, a code injection
vulnerability in a low-privileged workflow (for example
`permissions: {contents: read}` and no secrets) is not a big deal,
because the attacker cannot do much more than poison the repository
cache (which requires no permissions). If caching is only used in other
low-privileged workflows, the impact is limited. However, if a
high-privileged workflow like the release build consumes the cache, then
it becomes a real problem.

As @AdnaneKhan concludes in his blog posts about GitHub Actions cache
poisoning, such as
https://adnanthekhan.com/2024/05/06/the-monsters-in-your-build-cache-github-actions-cache-poisoning/#dont-use-actions-caching-in-release-builds:
"the best way to protect the integrity of releases is to avoid using
GitHub Actions caching entirely for release workflows."

The README of `actions/setup-node` also recommends
`package-manager-cache: false` for privileged workflows (see
https://github.com/actions/setup-node/blob/53b83947a5a98c8d113130e565377fae1a50d02f/README.md#breaking-changes-in-v5):

> For workflows with elevated privileges or access to sensitive
> information, we recommend disabling automatic caching by setting
> `package-manager-cache: false` when caching is not needed for secure
> operation.
generalmimon added a commit to generalmimon/npm-documentation that referenced this pull request Apr 29, 2026
The PR npm#1917 bumped the
`actions/setup-node` action from v4 to v6. This made the publishing
GitHub Actions sample workflows potentially vulnerable to cache
poisoning, because v5 and later enable caching by default (see
https://github.com/actions/setup-node/blob/53b83947a5a98c8d113130e565377fae1a50d02f/README.md#breaking-changes-in-v5).
v6 only enables automatic caching if the `packageManager` field in
package.json is set to `npm`.

Consuming GitHub Actions cache in publishing workflows is discouraged,
because the cache may be poisoned by compromising any low-privileged
workflow in the same repository. Normally, a code injection
vulnerability in a low-privileged workflow (for example
`permissions: {contents: read}` and no secrets) is not a big deal,
because the attacker cannot do much more than poison the repository
cache (which requires no permissions). If caching is only used in other
low-privileged workflows, the impact is limited. However, if a
high-privileged workflow like the release build consumes the cache, then
it becomes a real problem.

As @AdnaneKhan concludes in his blog posts about GitHub Actions cache
poisoning, such as
https://adnanthekhan.com/2024/05/06/the-monsters-in-your-build-cache-github-actions-cache-poisoning/#dont-use-actions-caching-in-release-builds:
"the best way to protect the integrity of releases is to avoid using
GitHub Actions caching entirely for release workflows."

The README of `actions/setup-node` also recommends
`package-manager-cache: false` for privileged workflows (see
https://github.com/actions/setup-node/blob/53b83947a5a98c8d113130e565377fae1a50d02f/README.md#breaking-changes-in-v5):

> For workflows with elevated privileges or access to sensitive
> information, we recommend disabling automatic caching by setting
> `package-manager-cache: false` when caching is not needed for secure
> operation.
owlstronaut pushed a commit that referenced this pull request May 4, 2026
The PR #1917 bumped the
`actions/setup-node` action from v4 to v6. This made the publishing
GitHub Actions sample workflows potentially vulnerable to cache
poisoning, because v5 and later enable caching by default (see
https://github.com/actions/setup-node/blob/53b83947a5a98c8d113130e565377fae1a50d02f/README.md#breaking-changes-in-v5).
v6 only enables automatic caching if the `packageManager` field in
package.json is set to `npm`.

Consuming GitHub Actions cache in publishing workflows is discouraged,
because the cache may be poisoned by compromising any low-privileged
workflow in the same repository. Normally, a code injection
vulnerability in a low-privileged workflow (for example `permissions:
{contents: read}` and no secrets) is not a big deal, because the
attacker cannot do much more than poison the repository cache (which
requires no permissions). If caching is only used in other
low-privileged workflows, the impact is limited. However, if a
high-privileged workflow like the release build consumes the cache, then
it becomes a real problem.

As @AdnaneKhan concludes in his blog posts about GitHub Actions cache
poisoning, such as
https://adnanthekhan.com/2024/05/06/the-monsters-in-your-build-cache-github-actions-cache-poisoning/#dont-use-actions-caching-in-release-builds:
"the best way to protect the integrity of releases is to avoid using
GitHub Actions caching entirely for release workflows."

The README of `actions/setup-node` also recommends
`package-manager-cache: false` for privileged workflows (see
https://github.com/actions/setup-node/blob/53b83947a5a98c8d113130e565377fae1a50d02f/README.md#breaking-changes-in-v5):

> For workflows with elevated privileges or access to sensitive
information, we recommend disabling automatic caching by setting
`package-manager-cache: false` when caching is not needed for secure
operation.

## References

Related to #1917
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.

2 participants