Skip to content

Commit 1e91572

Browse files
committed
fix the rule issues
1 parent d5f2547 commit 1e91572

File tree

527 files changed

+28709
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

527 files changed

+28709
-95
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ from
1717
Method get
1818
where
1919
httpHandleFuncCall.getTarget().hasQualifiedName("net/http", "HandleFunc") and
20-
httpHandleFuncCall.getNumArgument() > 1 and
21-
httpHandleFuncCall.getArgument(0).getType().getUnderlyingType() = StringType and
22-
httpHandleFuncCall.getArgument(0).getStringValue().matches("%/\"") and
23-
// Trace the second argument's data flow to its predecessor
24-
predecessor = httpHandleFuncCall.getArgument(1).getAPredecessor() and
25-
// Find the corresponding expression for the predecessor
20+
httpHandleFuncCall.getArgument(0).getType().getUnderlyingType() instanceof StringType and
21+
httpHandleFuncCall.getArgument(0).getStringValue().matches("%/") and
2622
get.hasQualifiedName("net/http", "Header", "Set") and
2723
call = get.getACall() and
28-
call.getArgument(0).getStringValue() = "\"Cache-Control\""
24+
call.getArgument(0).getStringValue() = "Cache-Control"
2925
select httpHandleFuncCall.getArgument(0), call.getArgument(0)

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

Lines changed: 0 additions & 88 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"languages":{"go":{"displayName":"Go","files":["WebCacheDeceptionBad.go"],"linesOfCode":63,"name":"go"}}}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
sourceLocationPrefix: /Users/yunus.aydin/Research/codeql-fork/go/ql/src/experimental/CWE-525
3+
baselineLinesOfCode: 63
4+
unicodeNewlines: false
5+
columnKind: utf8
6+
primaryLanguage: go
7+
creationMetadata:
8+
cliVersion: 2.15.2
9+
creationTime: 2023-11-15T12:38:41.355081Z
10+
finalised: true
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

go/ql/src/experimental/CWE-525/wcd/db-go/default/cache/.lock

Whitespace-only changes.

0 commit comments

Comments
 (0)