• Meron35@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 days ago

    As someone completely unfamiliar with the JavaScript mess, are these security issues specific to npm the actual repository or npm the package manager?

    If it’s the latter, does using something else like yarn or bun instead help?

    • delcaran@feddit.it
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 days ago

      It’s not, it’s a problem of every package manager that do not use sources and checksums, like rust and python. Take a look at this article that does a better job then me at explaining the situation.

      • arcterus@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        4 days ago

        In a recent analysis, Adam Harvey found that among the 999 most popular crates on crates.io, around 17% contained code that do not match their code repository.

        17%!

        Let me rephrase this, 17% of the most popular Rust packages contain code that virtually nobody knows what it does (I can’t imagine about the long tail which receives less attention).

        Given that he lied about the results of the analysis he is using to prove his point, I find it hard to trust anything in this article.

        In the analysis, Harvey said only 8 repositories did not match their upstream repos. The other problems were issues like not including the VCS info, squashing history, etc.

        EDIT: Also, I just noticed that he called it a “recent” analysis. It’s roughly a two year old analysis. I expect things have improved a bit since then, especially since part of the problem was packaging using older versions of Cargo.

      • anyhow2503@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 days ago

        The good news is that there already is a gold standard for supply chain security: the Go programming language.

        Lmfao

        • bright_side_@piefed.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 days ago

          Competent standard lib + decentralized libs + checksum db.

          While the article is a bit theatralic, it offers important arguments.

          • anyhow2503@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            ·
            4 days ago

            There are some good points in it, though I wouldn’t really consider go dependencies all that decentralized in practice and I don’t understand how checksum db will protect against supply chain attacks with stolen credentials, but I admit I haven’t looked into the details.

    • [object Object]@lemmy.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 days ago

      I think npm allows installation scripts which do make this worse, as a package can run arbitrary command at install time.

      • anyhow2503@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 days ago

        Npm has gotten a few config options that prevent this behaviour. We can only hope that they will become the default eventually.