Skip to content

Commit 29e14f7

Browse files
committed
Feedback, Format, Add Change Notes
1 parent 8960453 commit 29e14f7

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lgtm,codescanning
2+
* Added [http.Error](https://pkg.go.dev/net/http#Error) to XSS sanitzers.

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,16 @@ module SharedXss {
108108
)
109109
}
110110
}
111-
/**
112-
* A http.Error function returns with the ContentType of text/plain, and is not a valid XSS sink
113-
*/
114-
class ErrorSanitizer extends Sanitizer{
111+
112+
/**
113+
* A http.Error function returns with the ContentType of text/plain, and is not a valid XSS sink
114+
*/
115+
class ErrorSanitizer extends Sanitizer {
115116
ErrorSanitizer() {
116-
exists(Function f, DataFlow::CallNode call | f = call.getCall().getTarget() | f.hasQualifiedName("net/http", "Error")
117-
and call.getArgument(1) = this)
117+
exists(Function f, DataFlow::CallNode call | call = f.getACall() |
118+
f.hasQualifiedName("net/http", "Error") and
119+
call.getArgument(1) = this
120+
)
118121
}
119122
}
120123

0 commit comments

Comments
 (0)