Feedback, Format, Add Change Notes

This commit is contained in:
Kevin Stubbings
2023-08-28 14:15:21 -07:00
parent 8960453662
commit 29e14f7d8d
2 changed files with 11 additions and 6 deletions

View File

@@ -0,0 +1,2 @@
lgtm,codescanning
* Added [http.Error](https://pkg.go.dev/net/http#Error) to XSS sanitzers.

View File

@@ -108,13 +108,16 @@ module SharedXss {
)
}
}
/**
* A http.Error function returns with the ContentType of text/plain, and is not a valid XSS sink
*/
class ErrorSanitizer extends Sanitizer{
/**
* A http.Error function returns with the ContentType of text/plain, and is not a valid XSS sink
*/
class ErrorSanitizer extends Sanitizer {
ErrorSanitizer() {
exists(Function f, DataFlow::CallNode call | f = call.getCall().getTarget() | f.hasQualifiedName("net/http", "Error")
and call.getArgument(1) = this)
exists(Function f, DataFlow::CallNode call | call = f.getACall() |
f.hasQualifiedName("net/http", "Error") and
call.getArgument(1) = this
)
}
}