Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hawk dependency causes security risk #2874

Closed
lightkraken opened this issue Feb 15, 2018 · 19 comments
Closed

Hawk dependency causes security risk #2874

lightkraken opened this issue Feb 15, 2018 · 19 comments
Labels

Comments

@lightkraken
Copy link

lightkraken commented Feb 15, 2018

I recently ran a Node Security scan on a project that uses Request and found a security issue related to the version of Hawk (and subsequently Hoek) that Request is using.

request@2.83.0 > hawk@6.0.2 > hoek@4.2.0

https://nodesecurity.io/advisories/566
https://hackerone.com/reports/310439

@KittyGiraudel
Copy link

KittyGiraudel commented Feb 16, 2018

Yup! Same one, with different path (for some reason…?):

request@2.83.0 > hawk@3.1.3 > hoek@2.16.3

@andreasvoigt
Copy link

andreasvoigt commented Feb 16, 2018

Latest hawk version is 7.0.7 which uses hoek@5.x.x.
Updating to that version would fix the problem.

santiagogil added a commit to santiagogil/request that referenced this issue Feb 16, 2018
In order to avoid a known vulnerability in hoek.
request@2.83.0 > hawk@6.0.2 > hoek@4.2.0

https://nodesecurity.io/advisories/566
https://hackerone.com/reports/310439

Closes request#2874
@santiagogil santiagogil mentioned this issue Feb 16, 2018
3 tasks
@erik-beus
Copy link

This is also an issue with earlier releases. We use node-sass which uses request ~2.79.0 that uses hawk@3.1.3. Would it be possible to patch earlier releases with the latest version of hawk as well?
Otherwise I will open an issue in the node-sass repo to upgrade their version of request.

Btw hoek@4.2.1 has a fix for the security issue (see https://github.com/hapijs/hoek/pull/231/files)
I believe that solves the issue for hawk@6.0.2 since it uses hoek@4.x.x?

@ferrao
Copy link

ferrao commented Feb 18, 2018

Bcrypt, with more than half a million downloads last month according to npm is also vulnerable to the Prototype Pollution Attack due to bcrypt@1.0.3 > node-pre-gyp@0.6.36 > request@2.83.0 > hawk@6.0.2 > hoek@4.2.0

@erik-beus
Copy link

@ferrao there is an open issue in node-pre-gyp for this mapbox/node-pre-gyp#346

@b4dnewz
Copy link

b4dnewz commented Feb 27, 2018

Just update hawk line to >= v7.x.x hoek has been updated to last which is patched according to nsp:

┌────────────┬────────────────────────────────────────────────────────────────────┐
│            │ Prototype pollution attack                                         │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Name       │ hoek                                                               │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ CVSS       │ 4 (Medium)                                                         │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Installed  │ 4.2.0                                                              │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Vulnerable │ <= 4.2.0 || >= 5.0.0 < 5.0.3                                       │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Patched    │ > 4.2.0 < 5.0.0 || >= 5.0.3                                        │
└────────────┴────────────────────────────────────────────────────────────────────┘

@dutscher
Copy link

+1

@esrose
Copy link

esrose commented Mar 7, 2018

Is there a timeline for publishing 2.83.2 with the new hawk version to resolve this issue?

@jwalton
Copy link

jwalton commented Mar 8, 2018

@preeteshjain raised a PR, but there are a number of test failures, so it might not be a trivial fix.

@preeteshjain
Copy link

@jwalton There's definitely some issue with the CI integration. I checked on Travis, it is failing with this error for everyone:

npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! request@2.83.1 test-ci: `taper tests/test-*.js`
npm ERR! Exit status 6
npm ERR! 
npm ERR! Failed at the request@2.83.1 test-ci script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2018-03-03T22_16_02_776Z-debug.log
npm ERR! Test failed.  See above for more details.

See this comment: #2871 (comment)

@b4dnewz
Copy link

b4dnewz commented Mar 9, 2018

@preeteshjain actually for me the tests doesn't work locally either

@denghongcai
Copy link

-1

break node6 support
https://travis-ci.org/request/request/jobs/352225158

@saitho
Copy link

saitho commented Mar 13, 2018

break node6 support

Then we should update the required NodeJS version for request to a version that is working... ;) Also since the current LTS is 8,10,0 I don't see a point to insist on using NodeJS 6.
If this package is using semantic versioning that would mean a v3.0.0. ;) @simov

@kara-ryli
Copy link

so since the current LTS is 8,10,0 I don't see a point to insist on using NodeJS 6.

Boron is in LTS until April 2019. Please do not break v6 support until it enters EOL.

@joshrickert
Copy link

Hoek's backported the fix and released it with 4.2.1, which satisfies the required versions all the way up the dependency tree without needing any changes in this repo. I was able to clear out the security notice by forcing an update:

npm install hoek@4.2.1 --save
npm uninstall hoek --save

Clearing out your node_modules and package-lock.json then running a fresh npm install should also do the trick.

@benwiggins
Copy link

Yep. hoek 4.2.1 was released 2 months ago to fix the vulnerability.

hawk@6.0.2's dependency on hoek is pinned at 4.x, meaning that if you reinstall fresh you should be pulling down 4.2.1. If you are pulling down 4.2.0 that is an issue with your project/package manager, not request.

@compulim
Copy link

And now hoek<~5.0.3 has vulnerability, in CVE-2018-3728.

@webextensions
Copy link

This seems to have been fixed. See:
#2893
#2893 (comment)

@stale
Copy link

stale bot commented Jun 7, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 7, 2019
@stale stale bot closed this as completed Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests