The Register Home Page

back to article Not pretty, not Windows-only: npm phishing attack laces popular packages with malware

The popular npm package "is" was infected with cross-platform malware, around the same time that linting utility packages used with the prettier code formatter were infected with Windows-only malware. This was likely caused by a phishing attack using a typosquatted clone of the official npm site. The "is" package is used for …

  1. m4r35n357 Silver badge

    Anyone see the problem?

    "The "is" package is used for JavaScript type testing" - WTF?

    1. abend0c4 Silver badge

      Re: Anyone see the problem?

      I think the issue is that people continue to download random software packages from the Internet without any form of verification, not what they're using them for. The behaviour has become so normalised hardly any one seems to give it a second thought.

      1. Falmari
        Devil

        Re: Anyone see the problem?

        "Npm packages are a valuable target for attackers. Developer machines are often a source of valuable credentials, packages are automatically downloaded as dependencies"

        That's the problem CI/CD of Malware.

      2. m4r35n357 Silver badge

        Re: Anyone see the problem?

        I have actually worked alongside web devs for a fair bit of my career, so I'm not just making shit up. It is one thing depending on these "non-essentials", but if I were the boss I would limit their use to prototyping.

        Next step - download the package _locally_ and check it over. Use your local copy.

        Even better, find the bits of functionality that you actually need and extract & sanitize them. Write your own code.

        Not exactly rocket science!

        1. Doctor Syntax Silver badge

          Re: Anyone see the problem?

          "if I were the boss"

          There's the problem, you're not. The actual boss probably wants as many corners cut as possible.

          1. MonkeyJuice Silver badge

            Re: Anyone see the problem?

            This. It looks really easy and a no-brainer because you're not at the end of your second 60 hour week with a burgeoning inbox and 50 unread slack notifications demanding you went live yesterday.

            Even the most seasoned devs and sysadmins can make big booboos under these kinds of pressures.

        2. John Brown (no body) Silver badge

          Re: Anyone see the problem?

          "Next step - download the package _locally_ and check it over. Use your local copy."

          Not always possible due to licence retrictions when using commercially

          "Even better, find the bits of functionality that you actually need and extract & sanitize them. Write your own code."

          Yes, this. If you can't licence it for local use, then don't use it :-)

    2. Brewster's Angle Grinder Silver badge

      Re: Anyone see the problem?

      I'm still not entirely sure. But here's one definition:

      is.defined = function (value) {

      return typeof value !== 'undefined';

      };

      It's syntactic sugar for a language feature.

      Some of the others are more involved and there are subtle issues which may need wrapping up in a function (i.e. cross realm). But Jordan could get this in the language, if he wanted. I like Javascript, but I despair of some of this.

  2. Doctor Syntax Silver badge

    Is it any wonder so many of us use NoScript?

    1. L. GASC

      Sorry Doc, but this pain be on the serving side; beyond the reach o’ the usual browser medication.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like