@profullstack/threatcrush 0.13.63 → 0.13.64
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/daemon.js +11 -4
- package/dist/daemon.js.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/daemon.js
CHANGED
|
@@ -16017,12 +16017,19 @@ async function runScan(targetPath) {
|
|
|
16017
16017
|
}
|
|
16018
16018
|
|
|
16019
16019
|
// src/commands/pentest.ts
|
|
16020
|
+
function decodeMarkupForXssDetection(html) {
|
|
16021
|
+
return html.replace(/</gi, "<").replace(/>/gi, ">").replace(/"/gi, '"').replace(/'|'/gi, "'").replace(/&#x([0-9a-f]+);?/gi, (_, hex) => String.fromCodePoint(parseInt(hex, 16))).replace(/&#([0-9]+);?/g, (_, dec) => String.fromCodePoint(parseInt(dec, 10)));
|
|
16022
|
+
}
|
|
16023
|
+
function containsXssPayload(html) {
|
|
16024
|
+
const candidate = decodeMarkupForXssDetection(html);
|
|
16025
|
+
return /<script\b[^>]*>[\s\S]*?\b(?:alert|confirm|prompt)\s*\(/i.test(candidate) || /<[a-z][^>]*\bon(?:error|load|mouseover|focus)\s*=\s*[^>]*(?:alert|confirm|prompt)\s*\(/i.test(candidate);
|
|
16026
|
+
}
|
|
16020
16027
|
var PENTEST_CHECKS = [
|
|
16021
16028
|
{
|
|
16022
|
-
name: "XSS
|
|
16023
|
-
test: (html) =>
|
|
16024
|
-
severity: "
|
|
16025
|
-
message: "
|
|
16029
|
+
name: "XSS Payload in Response",
|
|
16030
|
+
test: (html) => containsXssPayload(html),
|
|
16031
|
+
severity: "high",
|
|
16032
|
+
message: "Response contains an executable-looking XSS payload (raw or HTML-escaped)"
|
|
16026
16033
|
},
|
|
16027
16034
|
{
|
|
16028
16035
|
name: "Open Redirect",
|