Skip to content

Commit 8ff3832

Browse files
committed
update rule and expected file
1 parent 8a24daf commit 8ff3832

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

go/ql/src/experimental/CWE-525/WebCacheDeception.ql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212

1313
import go
1414

15-
from DataFlow::CallNode httpHandleFuncCall, Http::HeaderWrite::Range hw
15+
from
16+
DataFlow::CallNode httpHandleFuncCall, DataFlow::ReadNode rn, Http::HeaderWrite::Range hw,
17+
DeclaredFunction f
1618
where
1719
httpHandleFuncCall.getTarget().hasQualifiedName("net/http", "HandleFunc") and
1820
httpHandleFuncCall.getArgument(0).getType().getUnderlyingType() instanceof StringType and
1921
httpHandleFuncCall.getArgument(0).getStringValue().matches("%/") and
22+
rn.reads(f) and
23+
f.getParameter(0) = hw.getResponseWriter() and
2024
hw.getHeaderName() = "cache-control"
21-
select httpHandleFuncCall.getArgument(0), hw.getHeaderName()
25+
select httpHandleFuncCall.getArgument(0), hw.getResponseWriter()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| WebCacheDeceptionBad.go:82:18:82:31 | "/adminusers/" | cache-control |
1+
| WebCacheDeceptionBad.go:82:18:82:31 | "/adminusers/" | WebCacheDeceptionBad.go:45:25:45:25 | w |

0 commit comments

Comments
 (0)