{"id":1482,"date":"2022-02-07T15:10:55","date_gmt":"2022-02-07T22:10:55","guid":{"rendered":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/?p=1482"},"modified":"2022-02-20T05:42:13","modified_gmt":"2022-02-20T12:42:13","slug":"attack-of-the-packages","status":"publish","type":"post","link":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/2022\/02\/07\/attack-of-the-packages\/","title":{"rendered":"Attack of the Packages"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" data-src=\"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/Blog_1060x698-11-1024x674.jpeg\" alt=\"\" class=\"wp-image-1558 lazyload\" width=\"800\" height=\"527\" data-srcset=\"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/Blog_1060x698-11-1024x674.jpeg 1024w, https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/Blog_1060x698-11-300x198.jpeg 300w, https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/Blog_1060x698-11-768x506.jpeg 768w, https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/Blog_1060x698-11.jpeg 1060w\" data-sizes=\"(max-width: 800px) 100vw, 800px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 800px; --smush-placeholder-aspect-ratio: 800\/527;\" \/><\/figure>\n\n\n\n<p>Attackers have been increasingly uploading malicious packages to the popular JavaScript package repository, <a href=\"https:\/\/www.npmjs.com\/\">npm<\/a>, in order to gain access to sensitive information, set up botnets, steal cryptocurrency, and more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"npm-what-is-it\">&#8216;npm&#8217;, what is it?<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" data-src=\"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/800px-Npm-logo.svg_.png\" alt=\"\" class=\"wp-image-1483 lazyload\" width=\"343\" height=\"133\" data-srcset=\"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/800px-Npm-logo.svg_.png 800w, https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/800px-Npm-logo.svg_-300x117.png 300w, https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/800px-Npm-logo.svg_-768x299.png 768w\" data-sizes=\"(max-width: 343px) 100vw, 343px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 343px; --smush-placeholder-aspect-ratio: 343\/133;\" \/><\/figure>\n\n\n\n<p>Node Package Manager, better recognized by its acronym &#8216;npm&#8217;, is a free, open source software registry that was <a href=\"https:\/\/github.blog\/2020-03-16-npm-is-joining-github\/\">recently acquired by Microsoft-owned GitHub<\/a>. Upwards of 32,000 packages are uploaded monthly and an average of 17,000 package updates daily, npm hosts over 1.8 million JavaScript packages. <a href=\"https:\/\/www.npmjs.com\/about\">Created in 2009<\/a>, it has grown to become the center of JavaScript code sharing. With more than 11 million developers relying on its service, there is no doubt that attackers will aim to take advantage of this.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-attackers-choose-npm\">Why attackers choose npm<\/h2>\n\n\n\n<p>The nature of being open-source and free gives rise to one of technology&#8217;s greatest fears; a lack of security. Most of the packages uploaded to npm are maintained and verified by users and open-source communities, making the JavaScript ecosystem &#8216;ripe for exploitation by attackers&#8217;, according to open source security and management firm <a href=\"https:\/\/www.whitesourcesoftware.com\/\">WhiteSource<\/a>. A huge problem with npm packages is that they don&#8217;t need to be run or used &#8211; as long as they&#8217;re on the system, they are <a href=\"https:\/\/www.securityweek.com\/1300-malicious-packages-found-popular-npm-javascript-package-manager\">automatically given permission to do whatever they want<\/a>. <\/p>\n\n\n\n<p>It is estimated that there will be more than 2 billion websites by the end of 2022 and almost 98% of them will depend on JavaScript. The popularity and dependence of npm across numerous systems and applications provides exactly what attackers are looking for: quick distribution with a large audience. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" data-src=\"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/supply-chain-attack-01-1280x488-1-1024x390.png\" alt=\"\" class=\"wp-image-1571 lazyload\" width=\"907\" height=\"345\" data-srcset=\"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/supply-chain-attack-01-1280x488-1-1024x390.png 1024w, https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/supply-chain-attack-01-1280x488-1-300x114.png 300w, https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/supply-chain-attack-01-1280x488-1-768x293.png 768w, https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-content\/uploads\/sites\/115\/2022\/02\/supply-chain-attack-01-1280x488-1.png 1280w\" data-sizes=\"(max-width: 907px) 100vw, 907px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 907px; --smush-placeholder-aspect-ratio: 907\/345;\" \/><\/figure>\n\n\n\n<p>And indeed, attackers are taking advantage of the malicious opportunity that npm presents, having already targeted its popular registries to attack <a href=\"https:\/\/discord.com\/\">Discord<\/a> in <a href=\"https:\/\/threatpost.com\/discord-stealing-malware-npm-packages\/163265\/\">January<\/a> and <a href=\"https:\/\/threatpost.com\/malicious-npm-code-packages-discord\/176886\/\">December<\/a> last year.<\/p>\n\n\n\n<p>Attackers are utilizing the distributive nature of npm and focusing their attacks upstream to &#8216;infect existing components that are distributed downstream and installed potentially millions of times&#8217;, according to this <a href=\"https:\/\/www.whitesourcesoftware.com\/whitesource-npm-threat-report-for-javascript-package-registry\/\">npm Threat Report<\/a> by WhiteSource. In the last six months, WhiteSource identified more than 1,300 malicious packages that were uploaded to npm in 2021. Of the 1,300 packages, about 14 percent were found to steal sensitive information such as credentials while nearly 82 percent were acting as spies and trackers &#8211; passively or actively gathering information on unsuspecting clients.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-malware-and-more\">The malware, and more<\/h2>\n\n\n\n<p>As stated in this <a href=\"https:\/\/threatpost.com\/malicious-npm-packages-web-apps\/178137\/\">threatpost article<\/a>, here are some of the malware that WhiteSource detected and identified in their report:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>mos-sass-loader and css-resources-loader<\/strong>, which engage in brandjacking for remote code execution (RCE);<\/li><li><strong>circle-admin-web-app and browser-warning-ui<\/strong>, which select external packages including malware for download;<\/li><li><strong>@grubhubprod_cookbook<\/strong>, which engages in dependency confusion aimed at entering Grubhub company data<\/li><li><strong>H98dx<\/strong>, a remote shell executable that runs upon install to infect machine; and<\/li><li><strong>Azure-web-pubsub-express<\/strong>, which enables data aggregation that collects host information.<\/li><\/ul>\n\n\n\n<p>Earlier this year, researchers also observed a software supply chain attack in October which leveraged a popular npm library, <a href=\"https:\/\/www.securityweek.com\/critical-severity-warning-malware-embedded-popular-javascript-library\">ua-parser-js<\/a>, used to parse user agent strings to identify various user attributes, in order to gain access to sensitive data and vulnerable resources stored in the cloud. After they supposedly took control of the developers&#8217;s account, attackers managed to upload three versions of ua-parser-js, which at the time saw upwards of 8 million downloads a week, each containing malicious code that could <a href=\"https:\/\/www.cisa.gov\/uscert\/ncas\/current-activity\/2021\/10\/22\/malware-discovered-popular-npm-package-ua-parser-js\">allow attackers to steal sensitive information or even take control of the system. <\/a>GitHub issued an <a href=\"https:\/\/github.com\/advisories\/GHSA-pjwm-rvh2-c87w\">advisory<\/a> for the package, warning users to migrate their secrets and keys and consider their computer compromised. A quick response from the developer mitigated damage but the affected software had already remained in the popular repository for over three hours.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-does-this-mean-for-users\">What does this mean for users?<\/h2>\n\n\n\n<p>Fortunately for us, WhiteSource reports all its findings to npm, who removes the malicious packages from its registry. However, this process is not instantaneous. If a malicious package is detected and reported on a Friday, it is unlikely that the package is removed until the following Monday. Unfortunately, this means that it could have been downloaded thousands or even millions of times over the weekend. Unsurprisingly, WhiteSource also reports that Friday is a popular day for attackers to make their move. <\/p>\n\n\n\n<p>Businesses and individuals alike should be especially mindful when downloading packages on weekends, as that is when attackers are most likely to release malicious packages. Naturally, users should always take precautions when downloading software from open-source repositories such as npm and only update when you are confident in the content.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"references\">References<\/h2>\n\n\n\n<p><a href=\"https:\/\/threatpost.com\/malicious-npm-packages-web-apps\/178137\/\">https:\/\/threatpost.com\/malicious-npm-packages-web-apps\/178137\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.securityweek.com\/1300-malicious-packages-found-popular-npm-javascript-package-manager\">https:\/\/www.securityweek.com\/1300-malicious-packages-found-popular-npm-javascript-package-manager<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.npmjs.com\/about\">https:\/\/www.npmjs.com\/about<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Attackers have been increasingly uploading malicious packages to the popular JavaScript package repository, npm, in order to gain access to sensitive information, set up botnets, steal cryptocurrency, and more. &#8216;npm&#8217;, what is it? Node Package Manager, better recognized by its acronym &#8216;npm&#8217;, is a free, open source software registry that was recently acquired by Microsoft-owned &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/2022\/02\/07\/attack-of-the-packages\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Attack of the Packages&#8221;<\/span><\/a><\/p>\n","protected":false},"author":394,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[15],"tags":[],"class_list":["post-1482","post","type-post","status-publish","format-standard","hentry","category-cpsc-329-602-w22","entry"],"featured_image_src":null,"featured_image_src_square":null,"author_info":{"display_name":"Anthony Nguyen","author_link":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/author\/anthony-nguyen\/"},"_links":{"self":[{"href":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-json\/wp\/v2\/posts\/1482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-json\/wp\/v2\/users\/394"}],"replies":[{"embeddable":true,"href":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-json\/wp\/v2\/comments?post=1482"}],"version-history":[{"count":14,"href":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-json\/wp\/v2\/posts\/1482\/revisions"}],"predecessor-version":[{"id":2098,"href":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-json\/wp\/v2\/posts\/1482\/revisions\/2098"}],"wp:attachment":[{"href":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-json\/wp\/v2\/media?parent=1482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-json\/wp\/v2\/categories?post=1482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpsites.ucalgary.ca\/isec-601-f21\/wp-json\/wp\/v2\/tags?post=1482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}