actions / actions/toolkit

[@actions/artifact] Transitive dependency `buffers` has no declared license

Open
#2,392 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Summary

@actions/artifact (used by actions/upload-artifact and actions/download-artifact) transitively depends on the npm package buffers, which does not declare a license and whose source repository has been deleted.

This makes it difficult for organizations with strict OSS license policies to adopt or continue using the official artifact actions.

Dependency chain

@actions/artifact
└── unzip-stream ^0.3.1                       (MIT)
    └── binary ^0.3.0                          (MIT, by substack)
        └── buffers ~0.1.1                     (NO LICENSE — by substack)

The buffers package is bundled into the published dist/index.js of both actions/upload-artifact and
actions/download-artifact (verified via signature strings such as "Tried to push a non-buffer").

Evidence

buffers has no license
  • npm registry entry: https://www.npmjs.com/package/buffers
    • license field: not present
    • Last published in 2013
  • GitHub repository referenced in package.json (github.com/substack/node-buffers) returns 404 — the repository has been deleted.
  • The published tarball contains no LICENSE file:
$ tar tzf buffers-0.1.1.tgz
package/examples/slice.js
package/examples/splice.js
package/index.js
package/package.json
package/README.markdown
package/test/buffers.js
Lockfile references

Why this matters

Many organizations classify "no declared license" as not redistributable / not usable by default, since using such code is technically copyright infringement (the absence of a
license grants no permissions). Even though GitHub Actions are run server-side, the bundled JavaScript is executed by the runner and constitutes use of the unlicensed code.

Several of our internal teams currently treat the official artifact actions as a policy exception, but it would be much cleaner if @actions/artifact did not pull in unlicensed code at all.

Suggested fixes (in order of preference)

  1. Replace unzip-stream with a maintained alternative that does not depend on binary/buffers. Candidates:
  • unzipper (MIT) — actively maintained, similar streaming API
  • yauzl (MIT) — well-maintained, used by VS Code
  • Node.js built-in zlib + custom ZIP parsing
  1. If keeping unzip-stream, file an upstream issue with mhr3/unzip-stream requesting they replace binary with an equivalent that does not
    depend on the unlicensed buffers.
  2. As a temporary workaround, override the resolution to point buffersnode-buffers (a re-publication of the same code by
    dashevo with an explicit MIT/X11 license). This requires a package.json overrides block, but bundles correctly.

Reproduction

# Inspect the bundled action
curl -fsSL https://raw.githubusercontent.com/actions/upload-artifact/main/dist/upload/index.js \
  | grep -c "Tried to push a non-buffer"
# 1   ← buffers code is present in the bundle

Related

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the @actions/artifact dependency chain and inspecting the package-lock.json node_modules/buffers entries, then use the provided curl and grep reproduction against the published dist/index.js bundles. Compare the proposed replacement approaches and verify that the resulting artifact actions no longer bundle the unlicensed buffers code while retaining the required ZIP functionality.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.