Skip to content

Commit e1f52b6

Browse files
renovate[bot]ardatangithub-actions[bot]
authored
chore(deps): update typescript-eslint monorepo to v8.46.3 (#4264)
* chore(deps): update typescript-eslint monorepo to v8.46.3 * Remove dset dependency * prevent prototype pollution attack * chore(dependencies): updated changesets for modified dependencies --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Arda TANRIKULU <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 6f83cea commit e1f52b6

File tree

5 files changed

+276
-39
lines changed

5 files changed

+276
-39
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"graphql-yoga": patch
3+
---
4+
dependencies updates:
5+
- Removed dependency [`dset@^3.1.4` ↗︎](https://www.npmjs.com/package/dset/v/3.1.4) (from `dependencies`)

examples/sveltekit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"@sveltejs/kit": "2.20.6",
2020
"@sveltejs/vite-plugin-svelte": "6.2.1",
2121
"@types/jest": "^30.0.0",
22-
"@typescript-eslint/eslint-plugin": "8.46.2",
23-
"@typescript-eslint/parser": "8.46.2",
22+
"@typescript-eslint/eslint-plugin": "8.46.3",
23+
"@typescript-eslint/parser": "8.46.3",
2424
"@whatwg-node/fetch": "0.10.11",
2525
"eslint": "9.39.1",
2626
"eslint-config-prettier": "10.1.8",

packages/graphql-yoga/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"@whatwg-node/fetch": "^0.10.6",
6060
"@whatwg-node/promise-helpers": "^1.2.4",
6161
"@whatwg-node/server": "^0.10.14",
62-
"dset": "^3.1.4",
6362
"lru-cache": "^10.0.0",
6463
"tslib": "^2.8.1"
6564
},

packages/graphql-yoga/src/plugins/request-parser/post-multipart.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { dset } from 'dset';
21
import { createGraphQLError } from '@graphql-tools/utils';
32
import { handleMaybePromise, MaybePromise } from '@whatwg-node/promise-helpers';
43
import { GraphQLParams } from '../../types.js';
@@ -48,7 +47,7 @@ export function parsePOSTMultipartRequest(request: Request): MaybePromise<GraphQ
4847
const file = requestBody.get(fileIndex);
4948
const keys = map[fileIndex]!;
5049
for (const key of keys) {
51-
dset(operations, key, file);
50+
setObjectKeyPath(operations, key, file);
5251
}
5352
}
5453
}
@@ -69,3 +68,24 @@ export function parsePOSTMultipartRequest(request: Request): MaybePromise<GraphQ
6968
},
7069
);
7170
}
71+
72+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
73+
function setObjectKeyPath(object: any, keyPath: string, value: any): void {
74+
const keys = keyPath.split('.');
75+
let current = object;
76+
for (let i = 0; i < keys.length; i++) {
77+
const key = keys[i]!;
78+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
79+
return;
80+
}
81+
const isLastKey = i === keys.length - 1;
82+
if (isLastKey) {
83+
current[key] = value;
84+
} else {
85+
if (!(key in current)) {
86+
current[key] = {};
87+
}
88+
current = current[key];
89+
}
90+
}
91+
}

0 commit comments

Comments
 (0)