@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/index.js
CHANGED
|
@@ -40055,12 +40055,19 @@ async function modulesCommand(opts) {
|
|
|
40055
40055
|
}
|
|
40056
40056
|
|
|
40057
40057
|
// src/commands/pentest.ts
|
|
40058
|
+
function decodeMarkupForXssDetection(html) {
|
|
40059
|
+
return html.replace(/</gi, "<").replace(/>/gi, ">").replace(/"/gi, '"').replace(/'|'/gi, "'").replace(/&#x([0-9a-f]+);?/gi, (_, hex3) => String.fromCodePoint(parseInt(hex3, 16))).replace(/&#([0-9]+);?/g, (_, dec) => String.fromCodePoint(parseInt(dec, 10)));
|
|
40060
|
+
}
|
|
40061
|
+
function containsXssPayload(html) {
|
|
40062
|
+
const candidate = decodeMarkupForXssDetection(html);
|
|
40063
|
+
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);
|
|
40064
|
+
}
|
|
40058
40065
|
var PENTEST_CHECKS = [
|
|
40059
40066
|
{
|
|
40060
|
-
name: "XSS
|
|
40061
|
-
test: (html) =>
|
|
40062
|
-
severity: "
|
|
40063
|
-
message: "
|
|
40067
|
+
name: "XSS Payload in Response",
|
|
40068
|
+
test: (html) => containsXssPayload(html),
|
|
40069
|
+
severity: "high",
|
|
40070
|
+
message: "Response contains an executable-looking XSS payload (raw or HTML-escaped)"
|
|
40064
40071
|
},
|
|
40065
40072
|
{
|
|
40066
40073
|
name: "Open Redirect",
|