File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
go/ql/lib/semmle/go/security Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -75,25 +75,18 @@ module OpenUrlRedirect {
7575 }
7676 }
7777
78- bindingset [ var, w]
79- pragma [ inline_late]
80- private predicate useIsDominated ( SsaWithFields var , Write w , DataFlow:: ReadNode sanitizedRead ) {
81- w .dominatesNode ( sanitizedRead .asInstruction ( ) ) and
82- sanitizedRead = var .getAUse ( )
83- }
84-
8578 /**
86- * An access to a variable that is preceded by an assignment to its `Path` field.
79+ * An assignment of a safe value to the field `Path`, considered as a barrier for sanitizing
80+ * untrusted URLs.
8781 *
8882 * This is overapproximate; this will currently remove flow through all `Url.Path` assignments
8983 * which contain a substring that could sanitize data.
9084 */
91- class PathAssignmentBarrier extends Barrier , Read {
85+ class PathAssignmentBarrier extends Barrier {
9286 PathAssignmentBarrier ( ) {
93- exists ( Write w , SsaWithFields var |
94- hasHostnameSanitizingSubstring ( w .getRhs ( ) ) and
95- w .writesFieldPreUpdate ( var .getAUse ( ) , any ( Field f | f .getName ( ) = "Path" ) , _) and
96- useIsDominated ( var , w , this )
87+ exists ( Write w , DataFlow:: Node rhs |
88+ hasHostnameSanitizingSubstring ( rhs ) and
89+ w .writesFieldPreUpdate ( this , any ( Field f | f .getName ( ) = "Path" ) , rhs )
9790 )
9891 }
9992 }
You can’t perform that action at this time.
0 commit comments