question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prototype pollution vulnearability due to hoek dependency

See original GitHub issue

Observed following security vulnerability in the grpc node package (even on latest version 1.10.0)

The merge function, and the applyToDefaults and applyToDefaultsWithShallow functions which leverage merge behind the scenes, are vulnerable to a prototype pollution attack when provided an unvalidated payload created from a JSON string containing the __proto__ property. This can be demonstrated like so: javascript var Hoek = require('hoek'); var malicious_payload = '{"__proto__":{"oops":"It works !"}}'; var a = {}; console.log("Before : " + a.oops); Hoek.merge({}, JSON.parse(malicious_payload)); console.log("After : " + a.oops);

This type of attack can be used to overwrite existing properties causing a potential denial of service. This can be fixed by updating the dependency version to hoek@4.2.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nicolasnoblecommented, May 4, 2018

1.11.1 has been published with the newest version of node-pre-gyp, and we’re upmerging this to master, yes.

1reaction
murgatroid99commented, Mar 16, 2018

That is actually a transitive dependency through node-pre-gyp, which will be updated in the next patch release. Until then, I don’t think there is any API surface for a malicious user to trigger this through gRPC.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prototype Pollution in @hapi/hoek | CVE-2020-36604 | Snyk
Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects.
Read more >
How to get rid of the 'hoek' vulnerabilities - Stack Overflow
The reason why prototype pollution smells is that it can cause security problems. This is the reason why it's labeled as Moderate ....
Read more >
Detecting Node.js Prototype Pollution Vulnerabilities via ...
ABSTRACT. Prototype pollution is a type of vulnerability specific to prototype- based languages, such as JavaScript, which allows an ...
Read more >
Fixing security vulnerabilities in npm dependencies in less ...
npm audit log showing minimist as a prototype pollution vulnerability. npm audit log. 2) Github security policy can also notify you — something...
Read more >
Empirical study on exploitation of dependency-based attacks ...
studied vulnerabilities, we found 111 prototype pollution packages (including ... This section briefly discusses the existing work-related dependency-based ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found