xploitscan-shared-rules 1.36.1 → 1.36.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 +7 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2399,8 +2399,12 @@ var sqlInjection = {
|
|
|
2399
2399
|
/["'`]\s*(?:SELECT|INSERT|UPDATE|DELETE)\b[^"'`\n]*\b(?:FROM|INTO|SET|VALUES|WHERE|JOIN|RETURNING)\b[^"'`\n]*\$\{(?!.*parameterized)/gi
|
|
2400
2400
|
];
|
|
2401
2401
|
const matches = [];
|
|
2402
|
-
const
|
|
2403
|
-
|
|
2402
|
+
const sqlLiterals = (content.match(/'(?:[^'\\\n]|\\.)*'|"(?:[^"\\\n]|\\.)*"|`(?:[^`\\]|\\.)*`/g) ?? []).filter(
|
|
2403
|
+
(lit) => /\b(?:SELECT|INSERT|UPDATE|DELETE)\b[\s\S]*\b(?:FROM|INTO|SET|VALUES|WHERE)\b/i.test(lit)
|
|
2404
|
+
);
|
|
2405
|
+
const usesParams = /\bprepare\b/i.test(content) || sqlLiterals.some((lit) => /\?\s*,|\?[^?,;]{1,20}\?|\$\d+|:[A-Za-z_]\w*|@[A-Za-z_]\w*|=\s*\?/.test(lit));
|
|
2406
|
+
const code = content.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:"'`\\])\/\/.*$/gm, "$1");
|
|
2407
|
+
if (usesParams || namesPlaceholderRun(code)) return [];
|
|
2404
2408
|
for (const pattern of patterns) {
|
|
2405
2409
|
const raw = findMatches(
|
|
2406
2410
|
content,
|
|
@@ -5812,7 +5816,7 @@ var complianceMap = {
|
|
|
5812
5816
|
VC111: { owasp: "A05:2021", cwe: "CWE-653" },
|
|
5813
5817
|
VC112: { owasp: "A06:2021", cwe: "CWE-1104" },
|
|
5814
5818
|
VC113: { owasp: "A05:2021", cwe: "CWE-200" },
|
|
5815
|
-
VC114: { owasp: "A05:2021", cwe: "CWE-
|
|
5819
|
+
VC114: { owasp: "A05:2021", cwe: "CWE-668" },
|
|
5816
5820
|
VC115: { owasp: "A02:2021", cwe: "CWE-311" },
|
|
5817
5821
|
VC116: { owasp: "A05:2021", cwe: "CWE-770" },
|
|
5818
5822
|
VC117: { owasp: "A01:2021", cwe: "CWE-22" },
|