Skip to content

Commit c1e90ed

Browse files
committed
Active script for Detect Web Cache Deception with ID that exists in scanner.md
Signed-off-by: Eiliya Keshtkar <eiliyakeshtkar0@gmail.com>
1 parent 776c8f8 commit c1e90ed

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

active/WebCacheDeception.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const FLD_INSANE = [
9494

9595
function getMetadata() {
9696
return ScanRuleMetadata.fromYaml(`
97-
id: 100034
97+
id: 40039
9898
name: Web Cache Deception Detection
9999
description: >
100100
Detect Web Cache Deception in two ways: 1) add delimiters and a file with an extension, 2) combine the attack with path traversal.
@@ -114,10 +114,10 @@ alertTags:
114114
WASC-13: Information Leakage
115115
status: alpha
116116
alertRefOverrides:
117-
100034-1:
117+
40039-1:
118118
name: Web Cache Deception - Extension/Delimiter
119119
description: Detects Web Cache Deception via delimiters and file extension fuzzing.
120-
100034-2:
120+
40039-2:
121121
name: Web Cache Deception - Path Traversal
122122
description: Detects Web Cache Deception via path traversal technique.
123123
`);
@@ -261,7 +261,7 @@ function additionalFile2Cache(as, msg, orgPath, endWithSlash) {
261261
let evidence = findEvidence(as, newMsg);
262262

263263
if (xCache !== null && statusCode >= 200 && statusCode < 300 && evidence) {
264-
raiseAlert(as, "100034-1", payload, newMsg, newPath);
264+
raiseAlert(as, "40039-1", payload, newMsg, newPath);
265265
return true;
266266
}
267267
}
@@ -291,7 +291,7 @@ function pathTraversal2Cache(as, msg, orgPath, endWithSlash) {
291291
let xCache = newMsg.getResponseHeader().getHeader("X-Cache");
292292
let statusCode = newMsg.getResponseHeader().getStatusCode();
293293
if (xCache !== null && statusCode >= 200 && statusCode < 300 && findEvidence(as, newMsg)) {
294-
raiseAlert(as, "100034-2", payload, newMsg, newPath);
294+
raiseAlert(as, "40039-2", payload, newMsg, newPath);
295295
return;
296296
}
297297
}
@@ -300,12 +300,12 @@ function pathTraversal2Cache(as, msg, orgPath, endWithSlash) {
300300
function raiseAlert(as, alertRef, payload, newMsg, newPath) {
301301
let requestUri = newMsg.getRequestHeader().getURI().toString();
302302
let name, description;
303-
if (alertRef === "100034-1") {
303+
if (alertRef === "40039-1") {
304304
name = "Web Cache Deception - Extension/Delimiter";
305305
description = "The server appears to cache sensitive pages when accessed with file extensions or crafted delimiters. " +
306306
"When requesting '" + newPath + "', this could allow attackers to cache sensitive user pages " +
307307
"by appending file extensions or using delimiters, potentially exposing private data to other users.";
308-
} else if (alertRef === "100034-2") {
308+
} else if (alertRef === "40039-2") {
309309
name = "Web Cache Deception - Path Traversal";
310310
description = "The server appears vulnerable to web cache deception via path traversal technique. " +
311311
"When accessing '" + newPath + "', it may permit caching of sensitive resources due to improper path validation.";

0 commit comments

Comments
 (0)