2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

fix(security): fixed formToJSON prototype pollution vulnerability; (#6167)

This commit is contained in:
Dmitriy Mozgovoy
2024-01-03 21:37:32 +02:00
committed by GitHub
parent 75af1cdff5
commit 3c0c11cade
2 changed files with 24 additions and 0 deletions
+3
View File
@@ -49,6 +49,9 @@ function arrayToObject(arr) {
function formDataToJSON(formData) {
function buildPath(path, value, target, index) {
let name = path[index++];
if (name === '__proto__') return true;
const isNumericKey = Number.isFinite(+name);
const isLast = index >= path.length;
name = !name && utils.isArray(target) ? target.length : name;