Skip to content

Commit 9539532

Browse files
author
Yunus AYDIN
committed
Format Document
1 parent 1eb1293 commit 9539532

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* @name Web Cache Deception
3+
* @description A caching system has been detected on the application and is vulnerable to web cache deception. By manipulating the URL it is possible to force the application to cache pages that are only accessible by an authenticated user. Once cached, these pages can be accessed by an unauthenticated user.
4+
* @kind path-problem
5+
* @problem.severity error
6+
* @security-severity 9
7+
* @precision high
8+
* @id go/web-cache-deception
9+
* @tags security
10+
* external/cwe/cwe-525
11+
*/
12+
13+
import go
14+
15+
from
16+
DataFlow::CallNode httpHandleFuncCall, DataFlow::CallNode call, DataFlow::Node predecessor, Method get
17+
where
18+
httpHandleFuncCall.getTarget().hasQualifiedName("net/http", "HandleFunc") and
19+
httpHandleFuncCall.getNumArgument() > 1 and
20+
httpHandleFuncCall.getArgument(0).getType().toString() = "string" and
21+
httpHandleFuncCall.getArgument(0).toString().matches("%/\"") and
22+
// Trace the second argument's data flow to its predecessor
23+
predecessor = httpHandleFuncCall.getArgument(1).getAPredecessor() and
24+
// Find the corresponding expression for the predecessor
25+
get.hasQualifiedName("net/http", "Header", "Set") and
26+
call = get.getACall() and
27+
call.getArgument(0).toString().matches("\"Cache-Control\"")
28+
select httpHandleFuncCall.getArgument(0), call.getArgument(0)

0 commit comments

Comments
 (0)