• quick_snail@feddit.nl
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    2
    ·
    41 minutes ago

    Don’t. Use. Npm.

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

  • mazzilius_marsti@lemmy.world
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    4
    ·
    edit-2
    3 hours ago

    lots of people recommend bitwarden, but i am more at peace with an offline password manager that i control like Keepass. You can also go the GNU route and use “pass” on Linux too

    Or use a physical key like Yubikey to login

    • peskypry@lemmy.ml
      link
      fedilink
      English
      arrow-up
      32
      ·
      edit-2
      3 hours ago

      No. Offline password managers are also suspectible to supply chain risk.

    • aeiou_ckr@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      2 hours ago

      Only if yubibkey worked for more than the handful of sites/services. I have one for my bitwarden as majority of places want to send a text or us totp.

    • mlg@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      3 hours ago

      I’ve been trialing Vaultwarden for a while and while I do like the server sync setup and clean web access, the Bitwarden browser plugin is just okay despite being an “enterprise” solution. It misses probably about 20% of websites when creating a new account, forcing you to grab the password from the generator history and make a new entry manually.

      KeepassXC is much better in that regard, and it’s almost as good as the default credential handler of Firefox, and it lets you set up a bunch of custom stuff to extend the functionality if you want. Plus it has some neat kbdx options aside from AES256.

      Only downside is syncing, which I’m debating how I’ll deal with something better than syncthing on android (protocol is great, android makes it a PITA to have a background process if its not Google spyware).

  • [object Object]@lemmy.ca
    link
    fedilink
    English
    arrow-up
    116
    arrow-down
    5
    ·
    9 hours ago

    Can we stop using npm now?

    I swear to god the number of attacks like this or spawned from other attacks like this is fucking stupid. I’ve gender seen anything like it.

    • anyhow2503@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 minutes ago

      Npm probably has the biggest attack surface and many of the libraries hosted there are in extremely widespread use. They’ve taken some steps to mitigate these supply chain attacks, but as we’ve seen with more recent examples, it’s unrealistic to think they can be prevented completely. Most of these attacks use stolen developer credentials, which invalidates almost all potential security measures on the registry side and the best you can hope for is catching a malicious package quickly. To be clear: I think the JS ecosystem is uniquely positioned to be the prime target of supply chain attacks and while that doesn’t excuse the slow implementation of security measures from the npm team, the people arguing that other package managers and registries aren’t vulnerable to this have to be huffing fumes.

    • Meron35@lemmy.world
      link
      fedilink
      English
      arrow-up
      11
      ·
      5 hours 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
        3
        ·
        1 hour 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.

        • anyhow2503@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          20 minutes ago

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

          Lmfao

      • [object Object]@lemmy.ca
        link
        fedilink
        English
        arrow-up
        7
        ·
        3 hours 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
          1
          ·
          16 minutes ago

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

    • LurkingLuddite@piefed.social
      link
      fedilink
      English
      arrow-up
      26
      ·
      8 hours ago

      Genuine question. How is NPM more vulnerable than other repos? Haven’t similar supply chain attacks succeeded at least as well as this one through GitHub itself and even Linux package repos?

      • Serinus@lemmy.world
        link
        fedilink
        English
        arrow-up
        26
        ·
        6 hours ago

        Larger standard libraries do a lot. It’s a lot harder to sneak vulnerabilities into the basic C# or Java or C++ libraries than it is to add a vulnerability to something one dude maintains in the javascript ecosystem.

        And since javascript libraries tend to be so small and focused, it’s become standard practice for even other libraries to pull in as many of those as they want.

        And it stacks. Your libraries pull in other libraries which can pull in their own libraries. I had a project recently where I had maybe a dozen direct dependencies and they ended up pulling in 1,311 total libraries, largely all maintained by different people.

        In a more sane ecosystem like C#, all the basics like string manipulation, email, or logging have libraries provided by Microsoft that have oversight when they’re changed. There can be better, third-party libraries for these things (log4net is pretty great), but they have to compete with their reputation and value over the standard library, which tends to be a high bar. And libraries made on top of that system are generally pulling all those same, certified standard libraries. So you pull in 3 libraries and only one of those pulls in another third party single library. And you end up with 4 total third party libraries.

        Javascript just doesn’t really have a certified standard library.

        (This certified standard library doesn’t have to be proprietary. Microsoft has made C# open source, and Linus Torvalds with the Linux Kernel Organization holds ultimate responsibility for the Linux kernel.)

        • vithigar@lemmy.ca
          link
          fedilink
          English
          arrow-up
          6
          ·
          4 hours ago

          I will almost always choose .NET as my development platform when greenfielding a project for exactly this reason. It’s an incredibly robust standard library that virtually guarantees I won’t need to pull in a litany of additional utility libraries, and I can also expect that what libraries I do choose to bring in are highly unlikely to drag along a ridiculous parade of dependencies.

      • hersh@literature.cafe
        link
        fedilink
        English
        arrow-up
        11
        ·
        7 hours ago

        I don’t think you’ll find another major repo with so many real-world incidents though. Whether this is because of a systemic problem or just because it’s targeted more frequently, I’m not sure.

        • tempest@lemmy.ca
          link
          fedilink
          English
          arrow-up
          7
          arrow-down
          7
          ·
          6 hours ago

          As much as some people deride it Javascript is one of the most used languages on the planet.

          This is basically the same as people thinking windows is less secure because it’s more often targeted.

          JavaScript does have a bit of a problem with dependencies but it isn’t much different than other languages with built in package managers like rust. It’s just a bigger juicer target.

          • aesthelete@lemmy.world
            link
            fedilink
            English
            arrow-up
            8
            arrow-down
            2
            ·
            edit-2
            1 hour ago

            But Windows is less secure. Two things can be true at once. They are in the original topic too.

            The Java ecosystem is massive and decades old and I don’t hear one iota of the shit about maven central that I hear about npm.

            I guarantee that npm is full up with vibe coded bullshit at this point as well.

            I’m not sure what it even takes to upload a package to npm. Not even a pulse. I honestly never looked into it because the whole ecosystem is so rancid.

            EDIT: Look at how many shits in this are optional (and note the overall quality of the article as well): https://dev.to/aneshodza/publishing-your-first-npm-library-51k2. The ecosystem sucks.

      • Kairos@lemmy.today
        link
        fedilink
        English
        arrow-up
        4
        ·
        7 hours ago

        There’s a lot of features that make it a better package manager but nobody cares. Every project has hundreds of dependencies and packages use a minimum, not exact, version.

        • LurkingLuddite@piefed.social
          link
          fedilink
          English
          arrow-up
          3
          ·
          7 hours ago

          That sounds more like bad practices from the community. It definitely has ways to use exact versions. Not the least of which the lock file. Or the shrinkwrap file which public packages should be using.

          • dustyData@lemmy.world
            link
            fedilink
            English
            arrow-up
            4
            ·
            5 hours ago

            Any security system based on expecting good behavior from people is sure to fail. If NPM has no estructural features to enforce safe behaviors, it is vulnerable by default. As no person using it will apply safe practices unless forced to. Specially if the default, easiest, less friction behavior, is inherently unsafe.

            • LurkingLuddite@piefed.social
              link
              fedilink
              English
              arrow-up
              1
              ·
              4 hours ago

              I wouldn’t say pulling in higher versions is unsafe unless an attack like this succeeds. Otherwise it’s only an annoyance.

          • Serinus@lemmy.world
            link
            fedilink
            English
            arrow-up
            3
            arrow-down
            1
            ·
            6 hours ago

            Then you’re waiting forever on vulnerability patches. Especially if there are layers, and each layer waits to update.

    • i_am_not_a_robot@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      33
      ·
      8 hours ago

      This problem has nothing to do with NPM. Checkmarx was compromised last month, and during that compromise there were malicious VS Code extensions published to Visual Studio Code Marketplace. A Bitwarden developer says that somebody ran one of those malicious extensions, and GitHub API keys were stolen which were used in publishing the malicious CLI package.

      It’s probably better that it happened on NPM. If the CLI were only downloadable from the Bitwarden website, it would have likely taken longer for somebody to notice something was wrong.

      • realitaetsverlust@piefed.zip
        link
        fedilink
        English
        arrow-up
        13
        arrow-down
        2
        ·
        8 hours ago

        Yes, but NPM has been had countless security problems, this isn’t a new problem. Even tho this instance is not a problem of NPM itself, it still has been proven as one of the most unreliable and insecure package managers out there.

        • wizardbeard@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          10
          arrow-down
          1
          ·
          7 hours ago

          I’m not a particular fan of npm, but you’ll probably see this kind of thing with any package manager of similar size. More a matter of what’s the most attractive target than the package tech itself.

  • BlackEco@lemmy.blackeco.com
    link
    fedilink
    English
    arrow-up
    80
    ·
    10 hours ago

    It has only been available for 2h30 on NPM, so unless you had the misfortune of installing the latest version in this short window, you should be fine. Thankfully people have been able to quickly catch this.

  • elgordino@fedia.io
    link
    fedilink
    arrow-up
    11
    arrow-down
    3
    ·
    7 hours ago

    Everyone should be using minimumReleaseAge (or their package managers equivalent) to block installing recently updated packages.

  • Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    35
    ·
    10 hours ago

    reposting the tl;dr I wrote from another community…

    Yesterday, for about 1h30min (starting at 5:57pm ET / 21:57 UTC) anyone installing the latest version of the command line interface of bitwarden was installing malware.

    The malware steals GitHub/npm tokens, .ssh, .env, shell history, GitHub Actions and cloud secrets, then exfiltrates the data to private domains and as GitHub commits and doesn’t seem to be targeting Bitwarden specifically, or user vaults.

    There’s no evidence that end user vault data was accessed or at risk, or that production data or production systems were compromised, according to their official statement.

    It seems there were 334 bitwarden CLI downloads in this time period, some or many of which might have been from bots, so this is a higher bound to the number of affected users.

    • Corngood@lemmy.ml
      link
      fedilink
      English
      arrow-up
      11
      ·
      9 hours ago

      I really need to figure out a better sandboxing method for shells. It’s crazy to be things where my keys, browser data, shell history are all accessible.

      I do try to use firejail where possible, but it’s quite cumbersome. Every so often I look for tools to help with this, but everything is oriented around making a specific program (e.g. Firefox, steam) work.

      • Eager Eagle@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        7 hours ago

        yeah, about twice a year I use the CLI to backup my vault, and I’ve never felt comfortable installing an npm package to handle my vault. Now I’m definitely sandboxing it in a rootless container without internet next time. And installing a week old version, or older.