Skip to content

Published package.json includes "prepare": "husky" since 2.11.0 (Socket supply-chain score 99 -> 45) #159

Open

Description

@anas-asghar4831

Since 2.11.0 the published package.json contains "scripts.prepare": "husky" (2.9.2 did not).

Socket.dev's supply-chain score for the package dropped from 0.99 (2.9.2) to 0.45 (2.11.0, 2.11.1) with nothing else changing: its alert list is empty, and all four runtime deps (culori, fflate, node-html-better-parser, tslib) score 1.0. Tools that gate on Socket's score, such as react-doctor's supply-chain check, now fail for every project depending on @cantoo/pdf-lib.

npm does not run prepare on registry installs, so this is not exploitable. It is a dev-only husky hook that ended up in the tarball, and scanners see it as an install-time lifecycle script.

version Socket supplyChain published prepare
2.9.2 0.99 none
2.11.0 0.45 husky
2.11.1 0.45 husky

Suggested fix (PR incoming): strip it from the published copy only, in publish.yml before npm publish, with npm pkg delete scripts.prepare. Husky keeps working for contributors.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions