From 61b4a8b4c517b624fefe92738bcda093536daf68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6ssler?= Date: Mon, 9 Dec 2024 17:16:59 +0100 Subject: [PATCH] fix: Array length check --- library/helpers/attackPath.test.ts | 2 +- library/helpers/attackPath.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/helpers/attackPath.test.ts b/library/helpers/attackPath.test.ts index 1fbf9eba..d1b81e05 100644 --- a/library/helpers/attackPath.test.ts +++ b/library/helpers/attackPath.test.ts @@ -80,7 +80,7 @@ t.test("respects max depth and array length", async (t) => { ".prop".repeat(30), ]); - const testArr = Array.from({ length: 101 }, (_, i) => i.toString()); + const testArr = Array.from({ length: 150 }, (_, i) => i.toString()); t.same(get("50", testArr), [".[50]"]); t.same(get("99", testArr), [".[99]"]); diff --git a/library/helpers/attackPath.ts b/library/helpers/attackPath.ts index 8107e013..d690127c 100644 --- a/library/helpers/attackPath.ts +++ b/library/helpers/attackPath.ts @@ -76,7 +76,7 @@ export function getPathsToPayload( if (index > MAX_ARRAY_LENGTH) { break; } - traverse(item, path.concat({ type: "array", index }), depth + 1); + traverse(item, path.concat({ type: "array", index }), depth); } if (value.join().toLowerCase() === attackPayloadLowercase) {