Live data from Hacker News

Backdoor injected to NPM express-cookies package

news.ycombinator.com

1–10 of 18 posts

Backdoor injected to NPM express-cookies package

#1
Remote code injection vulnerability wild in public npm package, plausible-sounding 'express-cookies' and its dependency 'getcookies'. >10K downloads during April.

Vulnerable code: https://npm.runkit.com/getcookies/test/harness.js?t=1525249320108

https://www.npmjs.com/package/express-cookies

Re: Backdoor injected to NPM express-cookies package

#8
post #3

No links to git repo in the packages, big warning sign.

Suspiciously good looking profile pic for the developer too; https://www.google.com/search?tbs=sbi:AMhZZite6RvKwDFjIobMX-...

Because it's a crop from a stock photo with a male model (in fact, see the first image result on the page).

Re: Backdoor injected to NPM express-cookies package

#9
post #7

Can someone explain how the injection itself works? I assume it's the require doing the work, but its not so clear how that loads externally instead of from a path in filesystem?

It appears to be middleware that looks at headers, and if a certain condition is met, it'll basically execute https://nodejs.org/api/vm.html#vm_vm_runinthiscontext_code_o... against whatever the header has.
Post reply on HN