Prototype Pollution in merge-objects
Summary
GHSA-992f-wf4w-x36v: Prototype Pollution in merge-objects. Affects merge-objects versions >= 0.0.0. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The package under scrutiny is merge-objects, an npm package used for merging JavaScript objects. It provides a function that takes multiple objects as arguments and merges them into a single object. This package is widely used in JavaScript projects for object manipulation and data merging tasks. Unfortunately, all versions of merge-objects are vulnerable to Prototype Pollution.
Vulnerability Detail
Prototype Pollution is a vulnerability that occurs when an attacker can inject properties into existing JavaScript objects. In the case of merge-objects, the vulnerability allows an attacker to modify the prototype of an object being merged, leading to potential security issues. This can result in the modification of existing properties, addition of new properties, or even the execution of arbitrary code. The impact of this vulnerability can range from data integrity issues to remote code execution.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As there is no fix available, a possible workaround is to implement custom object merging logic in your code, ensuring that it is not susceptible to Prototype Pollution. Here's an example of a basic object merging function:
function mergeObjects(target, ...sources) {
for (const source of sources) {
for (const key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
}
Conclusion
In conclusion, merge-objects is vulnerable to Prototype Pollution, which can have serious security implications. Currently, there is no fix available for this vulnerability. It is crucial to consider using a secure alternative package and implement custom object merging logic if necessary. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for merge-objects →
FAQ
Prototype Pollution is a vulnerability that allows an attacker to inject properties into existing JavaScript objects, potentially leading to security issues.
merge-objects is an npm package used for merging JavaScript objects into a single object.
The consequences of this vulnerability can range from data integrity issues to remote code execution, depending on how the merged objects are used in the application.
No, currently there is no fix available for this vulnerability in merge-objects.
It is recommended to use an alternative package for object merging tasks that is not affected by Prototype Pollution.