• quick_snail@feddit.nl
    link
    fedilink
    English
    arrow-up
    57
    arrow-down
    13
    ·
    4 days ago

    Don’t. Use. Npm.

    That applies to pip and crate and all the other shitty lang package managers that totally fail at security

      • grandma@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        22
        ·
        4 days ago

        Easy, just vendor all your dependencies! Can’t have a supply chain attack if you are the supply chain.

      • quick_snail@feddit.nl
        link
        fedilink
        English
        arrow-up
        7
        arrow-down
        1
        ·
        3 days ago

        A package manager that uses cryptographic signatures. Apt had this since 2005 iirc. Use apt.

    • rmrf@lemmy.ml
      link
      fedilink
      English
      arrow-up
      12
      arrow-down
      5
      ·
      4 days ago

      Honestly just fine use computers at all, completely eliminate the remote attack vector. And only drink rain water since city water can be compromised.

      Or, recognize this is a normal part of using software and have more than 1 thing between you and a breach

      • quack@lemmy.zip
        link
        fedilink
        English
        arrow-up
        27
        arrow-down
        1
        ·
        3 days ago

        The rules of cybersecurity:

        1. Under no circumstances should you own a computer.

        2. If you absolutely must own a computer, under no circumstances should you connect it to the internet.

        3. If you absolutely must connect it to the internet, it’s too late and they already have you

        • HubertManne@piefed.social
          link
          fedilink
          English
          arrow-up
          3
          ·
          3 days ago

          I know this is a joke but im old enough we used to install the os and had it on the network and eventually update it but then it got to the point were like being connected to the internet for like a minute and the machines were compromised. Thats when we got off our duffs and started making custom installs that had updates and configurations and software pre installed before we even connected it to the net.

      • quick_snail@feddit.nl
        link
        fedilink
        English
        arrow-up
        3
        ·
        3 days ago

        Yep. And so many workplaces have had security vulnerabilities caused by dumb decisions that could have been easily avoided

      • Victor@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 days ago

        We just recently switched from npm to pnpm, due to all the supply chain attacks. I did the PR for it, even.

        Our release schedule is like a year though so we don’t really have to worry much about releasing compromised dependencies. But still, better to be on the safer side.

    • wizzim@infosec.pub
      link
      fedilink
      English
      arrow-up
      2
      ·
      4 days ago

      Unfortunately I have to use node for home project (Jellyfin tizen)

      I was wondering: would it be possible to run node in a sandbox to lower the scope of the attack? (i.e. not compromise my home computer) Or is maybe a full VM a better solution?

        • dieTasse@feddit.org
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 days ago

          In case of NPM version pinning is a good practice. But also set it to ignore post install scripts. They are a bad practice and only about 2 % of all packages use it so it is unlikely it will bother you. They, the post install scripts, were used in recent supply chain attacks btw (the axios). You can either set it project wide in .npmrc file, add ignore-scripts=true, that is good for project where multiple people collaborate. And/Or system wide by running npm config set ignore-scripts true for your personal workspace. You can also achieve it by using --ignore-scripts flag during npm install, but that is way too impractical to always think about it. Also I would recommend checking npq, its a wrapper around npm cli that will give you some security summary before installing anything (and it is able to give you warning about post install scripts).

          • captcha_incorrect@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            11 hours ago

            Wait, any package that I download via NPM could potentially have a script that will run unless I set it to false, when I install said package?

            • dieTasse@feddit.org
              link
              fedilink
              English
              arrow-up
              1
              ·
              edit-2
              3 hours ago

              Yes, that is exactly how the axios supply chain attack worked… It ran post install script (on dependency) that downloaded malware, ran it and even cleaned it up. Everything on that machine was compromised… It can be any dependency of dependency too, deep down in the tree…

      • quick_snail@feddit.nl
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 days ago

        Full VM and network isolation. and dont put anything important there (nor a reused password for auth)