|
|
9fa205 |
From 6aaa4f232f872ffbb60b8a2e2282748e22a9891f Mon Sep 17 00:00:00 2001
|
|
|
9fa205 |
From: Marco Carini <cmdcarini@gmail.com>
|
|
|
9fa205 |
Date: Mon, 3 Aug 2020 17:16:07 -0500
|
|
|
9fa205 |
Subject: [PATCH] dot-prop: patch 4.2.0 with fixes for CVE-2020-8116
|
|
|
9fa205 |
|
|
|
9fa205 |
Signed-off-by: rpm-build <rpm-build>
|
|
|
9fa205 |
---
|
|
|
9fa205 |
deps/npm/node_modules/dot-prop/index.js | 18 ++++++++++++++++++
|
|
|
9fa205 |
deps/npm/node_modules/dot-prop/package.json | 6 +++---
|
|
|
9fa205 |
deps/npm/node_modules/dot-prop/readme.md | 2 ++
|
|
|
9fa205 |
3 files changed, 23 insertions(+), 3 deletions(-)
|
|
|
9fa205 |
|
|
|
9fa205 |
diff --git a/deps/npm/node_modules/dot-prop/index.js b/deps/npm/node_modules/dot-prop/index.js
|
|
|
9fa205 |
index 15282bb..189831c 100644
|
|
|
9fa205 |
--- a/deps/npm/node_modules/dot-prop/index.js
|
|
|
9fa205 |
+++ b/deps/npm/node_modules/dot-prop/index.js
|
|
|
9fa205 |
@@ -1,6 +1,14 @@
|
|
|
9fa205 |
'use strict';
|
|
|
9fa205 |
const isObj = require('is-obj');
|
|
|
9fa205 |
|
|
|
9fa205 |
+const disallowedKeys = [
|
|
|
9fa205 |
+ '__proto__',
|
|
|
9fa205 |
+ 'prototype',
|
|
|
9fa205 |
+ 'constructor'
|
|
|
9fa205 |
+];
|
|
|
9fa205 |
+
|
|
|
9fa205 |
+const isValidPath = pathSegments => !pathSegments.some(segment => disallowedKeys.includes(segment));
|
|
|
9fa205 |
+
|
|
|
9fa205 |
function getPathSegments(path) {
|
|
|
9fa205 |
const pathArr = path.split('.');
|
|
|
9fa205 |
const parts = [];
|
|
|
9fa205 |
@@ -16,6 +24,10 @@ function getPathSegments(path) {
|
|
|
9fa205 |
parts.push(p);
|
|
|
9fa205 |
}
|
|
|
9fa205 |
|
|
|
9fa205 |
+ if (!isValidPath(parts)) {
|
|
|
9fa205 |
+ return [];
|
|
|
9fa205 |
+ }
|
|
|
9fa205 |
+
|
|
|
9fa205 |
return parts;
|
|
|
9fa205 |
}
|
|
|
9fa205 |
|
|
|
9fa205 |
@@ -26,6 +38,9 @@ module.exports = {
|
|
|
9fa205 |
}
|
|
|
9fa205 |
|
|
|
9fa205 |
const pathArr = getPathSegments(path);
|
|
|
9fa205 |
+ if (pathArr.length === 0) {
|
|
|
9fa205 |
+ return;
|
|
|
9fa205 |
+ }
|
|
|
9fa205 |
|
|
|
9fa205 |
for (let i = 0; i < pathArr.length; i++) {
|
|
|
9fa205 |
if (!Object.prototype.propertyIsEnumerable.call(obj, pathArr[i])) {
|
|
|
9fa205 |
@@ -58,6 +73,9 @@ module.exports = {
|
|
|
9fa205 |
|
|
|
9fa205 |
const root = obj;
|
|
|
9fa205 |
const pathArr = getPathSegments(path);
|
|
|
9fa205 |
+ if (pathArr.length === 0) {
|
|
|
9fa205 |
+ return;
|
|
|
9fa205 |
+ }
|
|
|
9fa205 |
|
|
|
9fa205 |
for (let i = 0; i < pathArr.length; i++) {
|
|
|
9fa205 |
const p = pathArr[i];
|
|
|
9fa205 |
diff --git a/deps/npm/node_modules/dot-prop/package.json b/deps/npm/node_modules/dot-prop/package.json
|
|
|
9fa205 |
index 40fefa3..93daf7d 100644
|
|
|
9fa205 |
--- a/deps/npm/node_modules/dot-prop/package.json
|
|
|
9fa205 |
+++ b/deps/npm/node_modules/dot-prop/package.json
|
|
|
9fa205 |
@@ -37,9 +37,9 @@
|
|
|
9fa205 |
"deprecated": false,
|
|
|
9fa205 |
"description": "Get, set, or delete a property from a nested object using a dot path",
|
|
|
9fa205 |
"devDependencies": {
|
|
|
9fa205 |
- "ava": "*",
|
|
|
9fa205 |
+ "ava": "1.4.1",
|
|
|
9fa205 |
"matcha": "^0.7.0",
|
|
|
9fa205 |
- "xo": "*"
|
|
|
9fa205 |
+ "xo": "0.24.0"
|
|
|
9fa205 |
},
|
|
|
9fa205 |
"engines": {
|
|
|
9fa205 |
"node": ">=4"
|
|
|
9fa205 |
@@ -73,7 +73,7 @@
|
|
|
9fa205 |
"bench": "matcha bench.js",
|
|
|
9fa205 |
"test": "xo && ava"
|
|
|
9fa205 |
},
|
|
|
9fa205 |
- "version": "4.2.0",
|
|
|
9fa205 |
+ "version": "4.2.1",
|
|
|
9fa205 |
"xo": {
|
|
|
9fa205 |
"esnext": true
|
|
|
9fa205 |
}
|
|
|
9fa205 |
diff --git a/deps/npm/node_modules/dot-prop/readme.md b/deps/npm/node_modules/dot-prop/readme.md
|
|
|
9fa205 |
index fab3b7a..0e18f78 100644
|
|
|
9fa205 |
--- a/deps/npm/node_modules/dot-prop/readme.md
|
|
|
9fa205 |
+++ b/deps/npm/node_modules/dot-prop/readme.md
|
|
|
9fa205 |
@@ -85,6 +85,8 @@ Path of the property in the object, using `.` to separate each nested key.
|
|
|
9fa205 |
|
|
|
9fa205 |
Use `\\.` if you have a `.` in the key.
|
|
|
9fa205 |
|
|
|
9fa205 |
+The following path components are invalid and results in `undefined` being returned: `__proto__`, `prototype`, `constructor`.
|
|
|
9fa205 |
+
|
|
|
9fa205 |
#### value
|
|
|
9fa205 |
|
|
|
9fa205 |
Type: `any`
|
|
|
9fa205 |
--
|
|
|
9fa205 |
2.26.2
|
|
|
9fa205 |
|