Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update process.py #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class HTTPStringToURLOpenMethodFlowConfig extends TaintTracking::Configuration {

override predicate isAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
exists(UrlConstructorCall u |
node1.asExpr() = u.protocolArg() and
node1.asExpr() = u.getProtocolArg() and
node2.asExpr() = u
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@

import java
import semmle.code.java.dataflow.FlowSources
import semmle.code.java.security.UnsafeDeserialization
import semmle.code.java.security.UnsafeDeserializationQuery


class UnsafeDeserializationConfig extends TaintTracking::Configuration {
UnsafeDeserializationConfig() { this = "UnsafeDeserializationConfig" }

override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }

override predicate isSink(DataFlow::Node sink) { sink instanceof UnsafeDeserializationSink }
}

from string type, int amount
where exists(string qid | qid = "java/unsafe-deserialization" and (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class HTTPStringToURLOpenMethodFlowConfig extends TaintTracking::Configuration {

override predicate isAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
exists(UrlConstructorCall u |
node1.asExpr() = u.protocolArg() and
node1.asExpr() = u.getProtocolArg() and
node2.asExpr() = u
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@

import java
import semmle.code.java.dataflow.FlowSources
import semmle.code.java.security.UnsafeDeserialization
import semmle.code.java.security.UnsafeDeserializationQuery


class UnsafeDeserializationConfig extends TaintTracking::Configuration {
UnsafeDeserializationConfig() { this = "UnsafeDeserializationConfig" }

override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }

override predicate isSink(DataFlow::Node sink) { sink instanceof UnsafeDeserializationSink }
}

from DataFlow::Node n, string type
where exists(string qid | qid = "java/unsafe-deserialization" and (
Expand Down
4 changes: 3 additions & 1 deletion process.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def get(array, i, default):
def codeql(*args):
args = [codeql_executable] + list(args)
print(' '.join(args), flush=True)
output = None
try:
output = subprocess.run(
args,
Expand All @@ -85,7 +86,8 @@ def codeql(*args):
except subprocess.CalledProcessError as cpe:
print('Command failed with exit code: ' + str(cpe.returncode))
print('stdout:')
print(cpe.output.decode())
output = cpe.output
print(output.decode())
print('stderr:')
print(cpe.stderr.decode(), flush=True)
raise
Expand Down