Skip to content

Commit 8a4ca7f

Browse files
authored
Merge pull request github#10026 from pwntester/patch-2
Go: Partial URLs should not sanitize against SSRF
2 parents cece307 + 352866b commit 8a4ca7f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Taking a slice is now considered a sanitizer for `SafeUrlFlow`.

go/ql/lib/semmle/go/security/SafeUrlFlowCustomizations.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@ module SafeUrlFlow {
3535
private class UnsafeUrlMethodEdge extends SanitizerEdge {
3636
UnsafeUrlMethodEdge() { this = any(UnsafeUrlMethod um).getACall().getReceiver() }
3737
}
38+
39+
/** Any slicing of the URL, considered as a sanitizer for safe URL flow. */
40+
private class StringSlicingEdge extends SanitizerEdge {
41+
StringSlicingEdge() { this = any(DataFlow::SliceNode sn) }
42+
}
3843
}

0 commit comments

Comments
 (0)