Skip to content

Commit 5ffc14d

Browse files
jkyberneeesCopilot
andauthored
Update lib/utils/queryparams.js
Co-authored-by: Copilot <[email protected]>
1 parent 426f3b5 commit 5ffc14d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/utils/queryparams.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ module.exports = (req, url) => {
3232
const searchParams = new URLSearchParams(search.replace(/\[\]=/g, '='))
3333

3434
for (const [name, value] of searchParams.entries()) {
35-
// Use Set for O(1) dangerous property lookup instead of multiple string comparisons
36-
if (DANGEROUS_PROPERTIES.has(name)) {
35+
// Split parameter name into segments by dot or bracket notation
36+
const segments = name.split(/[\.\[\]]+/).filter(Boolean)
37+
38+
// Check each segment against the dangerous properties set
39+
if (segments.some(segment => DANGEROUS_PROPERTIES.has(segment))) {
3740
continue // Skip dangerous property names
3841
}
3942

0 commit comments

Comments
 (0)