CVE-2020-7766
Arbitrary Code Execution in json-ptr
Severity by source
Trivy's own label is CRITICAL. Rated critical by NVD. Rated lower by GHSA (high).
Description
This affects all versions of package json-ptr. The issue occurs in the set operation (https://flitbit.github.io/json-ptr/classes/_src_pointer_.jsonpointer.htmlset) when the force flag is set to true. The function recursively set the property in the target object, however it does not properly check the key being set, leading to a prototype pollution.
Affected packages and fixed versions
| Source | Package | Fixed in |
|---|---|---|
| npm::GitHub Security Advisory npm | json-ptr | 2.1.0 |
References
- https://github.com/418sec/json-ptr/pull/3
- https://github.com/flitbit/json-ptr/blob/master/src/util.ts%23L174
- https://github.com/flitbit/json-ptr/commit/2539e3494c80af1eef24f0f433654a61f255f011
- https://nvd.nist.gov/vuln/detail/CVE-2020-7766
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1038396
- https://snyk.io/vuln/SNYK-JS-JSONPTR-1016939
- https://www.huntr.dev/bounties/2-npm-json-ptr
- https://www.npmjs.com/package/json-ptr