mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Fix up test
This commit is contained in:
@@ -150,8 +150,8 @@ private predicate isCleanIntent(Expr intent) {
|
||||
/**
|
||||
* Taint configuration tracking flow from variables containing sensitive information to broadcast intents.
|
||||
*/
|
||||
class SensitiveBroadcastConfig extends TaintTracking::Configuration {
|
||||
SensitiveBroadcastConfig() { this = "Sensitive Broadcast Configuration" }
|
||||
class SensitiveCommunicationConfig extends TaintTracking::Configuration {
|
||||
SensitiveCommunicationConfig() { this = "Sensitive Communication Configuration" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) {
|
||||
source.asExpr() instanceof SensitiveInfoExpr
|
||||
|
||||
@@ -14,7 +14,7 @@ import java
|
||||
import semmle.code.java.security.AndroidSensitiveCommunicationQuery
|
||||
import DataFlow::PathGraph
|
||||
|
||||
from SensitiveBroadcastConfig cfg, DataFlow::PathNode source, DataFlow::PathNode sink
|
||||
from SensitiveCommunicationConfig cfg, DataFlow::PathNode source, DataFlow::PathNode sink
|
||||
where cfg.hasFlowPath(source, sink)
|
||||
select sink.getNode(), source, sink, "Sending $@ to broadcast.", source.getNode(),
|
||||
"sensitive information"
|
||||
select sink.getNode(), source, sink, "This call may leak sensitive infomration from $@.",
|
||||
source.getNode(), "here"
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import java
|
||||
import semmle.code.java.security.AndroidSensitiveBroadcastQuery
|
||||
import semmle.code.java.security.AndroidSensitiveCommunicationQuery
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
import TestUtilities.InlineFlowTest
|
||||
|
||||
class HasFlowTest extends InlineFlowTest {
|
||||
override DataFlow::Configuration getTaintFlowConfig() { result = any(SensitiveBroadcastConfig c) }
|
||||
override DataFlow::Configuration getTaintFlowConfig() {
|
||||
result = any(SensitiveCommunicationConfig c)
|
||||
}
|
||||
|
||||
override DataFlow::Configuration getValueFlowConfig() { none() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user