Malicious Package Affecting getcookies package, versions *


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

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 IDnpm:getcookies:20180502
  • published3 May 2018
  • disclosed2 May 2018
  • creditUnknown

Introduced: 2 May 2018

Malicious CVE NOT AVAILABLE CWE-506  (opens in a new tab)

How to fix?

Avoid usage of this package altogether.

Overview

getcookies contains a malicious backdoor.

The backdoor works by parsing the user-supplied HTTP request.headers, looking for specifically formatted data that provides three different commands to the backdoor:

  • resetting the code buffer.
  • executing code located in the buffer by calling vm.runInThisContext, providing module.exports, required, req, res, and next as arguments.
  • loading remote code in to memory for execution.

These control codes allowed for an attacker to input arbitrary code into a running server and execute it.

The list of packages and their scripts are:

express-cookies
getcookies
http-fetch-cookies

References

CVSS Scores

version 3.1