mirror of
https://github.com/github/codeql.git
synced 2026-01-29 14:23:03 +01:00
HTTP: Use Field.getQualifiedName in UserControlledRequestField
Also autoformat.
This commit is contained in:
@@ -6,23 +6,19 @@ import go
|
||||
|
||||
private module StdlibHttp {
|
||||
/** An access to an HTTP request field whose value may be controlled by an untrusted user. */
|
||||
private class UserControlledRequestField extends UntrustedFlowSource::Range, DataFlow::FieldReadNode {
|
||||
private class UserControlledRequestField extends UntrustedFlowSource::Range,
|
||||
DataFlow::FieldReadNode {
|
||||
UserControlledRequestField() {
|
||||
exists(Type req, string fieldName |
|
||||
req.hasQualifiedName("net/http", "Request") and
|
||||
this.getField() = req.getField(fieldName) |
|
||||
exists(string fieldName | this.getField().hasQualifiedName("net/http", "Request", fieldName) |
|
||||
fieldName = "Body" or fieldName = "Form" or fieldName = "Header" or fieldName = "URL"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private class HeaderGetCall extends UntrustedFlowSource::Range, DataFlow::MethodCallNode {
|
||||
HeaderGetCall() {
|
||||
this.getTarget().hasQualifiedName("net/http", "Header", "Get")
|
||||
}
|
||||
HeaderGetCall() { this.getTarget().hasQualifiedName("net/http", "Header", "Get") }
|
||||
}
|
||||
|
||||
|
||||
private class StdlibResponseWriter extends HTTP::ResponseWriter::Range {
|
||||
StdlibResponseWriter() { this.getType().implements("net/http", "ResponseWriter") }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user