xploitscan-shared-rules 1.27.2 → 1.27.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2338,6 +2338,19 @@ var stripeWebhookUnprotected = {
2338
2338
  return matches;
2339
2339
  }
2340
2340
  };
2341
+ var PLACEHOLDER_IDENT_RE = /(?<![\w$])([\w$]*?)(placeholders?)(?![\w$])/gi;
2342
+ function namesPlaceholderRun(content) {
2343
+ PLACEHOLDER_IDENT_RE.lastIndex = 0;
2344
+ let m = PLACEHOLDER_IDENT_RE.exec(content);
2345
+ for (; m !== null; m = PLACEHOLDER_IDENT_RE.exec(content)) {
2346
+ const prefix = m[1];
2347
+ if (prefix === "") return true;
2348
+ const boundary = prefix[prefix.length - 1];
2349
+ if (boundary === "_" || boundary === "$") return true;
2350
+ if (/[a-z0-9]/.test(boundary) && /[A-Z]/.test(m[2][0])) return true;
2351
+ }
2352
+ return false;
2353
+ }
2341
2354
  var sqlInjection = {
2342
2355
  id: "VC006",
2343
2356
  title: "Potential SQL Injection",
@@ -2373,8 +2386,8 @@ var sqlInjection = {
2373
2386
  /["'`]\s*(?:SELECT|INSERT|UPDATE|DELETE)\b[^"'`\n]*\b(?:FROM|INTO|SET|VALUES|WHERE|JOIN|RETURNING)\b[^"'`\n]*\$\{(?!.*parameterized)/gi
2374
2387
  ];
2375
2388
  const matches = [];
2376
- const usesParams = /\?\s*,|\?[^?,;]{1,20}\?|\$\d+|:[\w]+|\bprepare\b|\bplaceholders?\b/i.test(content);
2377
- if (usesParams) return [];
2389
+ const usesParams = /\?\s*,|\?[^?,;]{1,20}\?|\$\d+|:[\w]+|\bprepare\b/i.test(content);
2390
+ if (usesParams || namesPlaceholderRun(content)) return [];
2378
2391
  for (const pattern of patterns) {
2379
2392
  const raw = findMatches(
2380
2393
  content,