8000 Protection against lockfile injection attack · Issue #4361 · pnpm/pnpm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Protection against lockfile injection attack #4361
Open
@ai

Description

@ai

Describe the user story

We need some solution from lockfile injection attack.

(It also could be a huge selling point for pnpm.)

Describe the solution you'd like

  1. We can have an allow-list of hosts and some simple checks that URL is valid to package name and version.
  2. During install, we can check every record with this simple checks (is it npmjs.com URL? Does package name and version match URL?)
  3. If we have a non-standard URL, we run a more slow check, that URL is the real result of package.json. For instance, if package.json has non-standard package with full URL in version.
  4. Additionally, we can add option to define allow-list of domains (and maybe enable it in next major).

Describe the drawbacks of your solution

It could affect performance. But this two-check way should not create any problems for most of use cases (where we have packages from npm).

Describe alternatives you've considered

We can define allow-list of domains, but it will not fix the problem. We can publish is-nummber-bad and replace is-number’s URL in lockfile to is-nummber-bad URL.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0