mirror of
https://github.com/github/codeql.git
synced 2026-03-04 22:56:47 +01:00
Use new TypeInputStream
This commit is contained in:
@@ -239,7 +239,7 @@ private class BulkData extends RefType {
|
||||
this.(Array).getElementType().(PrimitiveType).hasName(["byte", "char"])
|
||||
or
|
||||
exists(RefType t | this.getASourceSupertype*() = t |
|
||||
t.hasQualifiedName("java.io", "InputStream") or
|
||||
t instanceof TypeInputStream or
|
||||
t.hasQualifiedName("java.nio", "ByteBuffer") or
|
||||
t.hasQualifiedName("java.lang", "Readable") or
|
||||
t.hasQualifiedName("java.io", "DataInput") or
|
||||
@@ -259,7 +259,7 @@ private class BulkData extends RefType {
|
||||
private predicate inputStreamWrapper(Constructor c, int argi) {
|
||||
not c.fromSource() and
|
||||
c.getParameterType(argi) instanceof BulkData and
|
||||
c.getDeclaringType().getASourceSupertype+().hasQualifiedName("java.io", "InputStream")
|
||||
c.getDeclaringType().getASourceSupertype+() instanceof TypeInputStream
|
||||
}
|
||||
|
||||
/** An object construction that preserves the data flow status of any of its arguments. */
|
||||
|
||||
@@ -102,7 +102,7 @@ private module Dispatch {
|
||||
or
|
||||
t instanceof Interface and not t.fromSource()
|
||||
or
|
||||
t.hasQualifiedName("java.io", "InputStream")
|
||||
t instanceof TypeInputStream
|
||||
or
|
||||
t.hasQualifiedName("java.io", "Serializable")
|
||||
or
|
||||
|
||||
@@ -317,7 +317,7 @@ class SystemSetInputStreamMethod extends Method {
|
||||
SystemSetInputStreamMethod() {
|
||||
this.hasName("setIn") and
|
||||
this.getNumberOfParameters() = 1 and
|
||||
this.getParameter(0).getType().(RefType).hasQualifiedName("java.io", "InputStream") and
|
||||
this.getParameter(0).getType() instanceof TypeInputStream and
|
||||
this.getDeclaringType()
|
||||
.getAnAncestor()
|
||||
.getSourceDeclaration()
|
||||
|
||||
@@ -237,7 +237,7 @@ class SpringRequestMappingParameter extends Parameter {
|
||||
|
||||
private predicate isExplicitlyTaintedInput() {
|
||||
// InputStream or Reader parameters allow access to the body of a request
|
||||
this.getType().(RefType).getAnAncestor().hasQualifiedName("java.io", "InputStream") or
|
||||
this.getType().(RefType).getAnAncestor() instanceof TypeInputStream or
|
||||
this.getType().(RefType).getAnAncestor().hasQualifiedName("java.io", "Reader") or
|
||||
// The SpringServletInputAnnotations allow access to the URI, request parameters, cookie values and the body of the request
|
||||
this.getAnAnnotation() instanceof SpringServletInputAnnotation or
|
||||
|
||||
Reference in New Issue
Block a user