mirror of
https://github.com/github/codeql.git
synced 2026-05-25 00:27:09 +02:00
Improve positive prompt examples:
Include only sinks that are arguments to an external API call, because these are the sinks we are most interested in.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
private import java
|
||||
import semmle.code.java.dataflow.TaintTracking
|
||||
private import semmle.code.java.security.ExternalAPIs as ExternalAPIs
|
||||
private import experimental.adaptivethreatmodeling.EndpointCharacteristics as EndpointCharacteristics
|
||||
private import experimental.adaptivethreatmodeling.EndpointTypes
|
||||
private import experimental.adaptivethreatmodeling.ATMConfig as AtmConfig
|
||||
@@ -34,6 +35,9 @@ where
|
||||
// treated by the actual query as a sanitizer, since the final logic is something like
|
||||
// `isSink(n) and not isSanitizer(n)`. We don't want to include such nodes as positive examples in the prompt.
|
||||
not config.isSanitizer(sink) and
|
||||
// Include only sinks that are arguments to an external API call, because these are the sinks we are most interested
|
||||
// in.
|
||||
sink instanceof ExternalAPIs::ExternalApiDataNode and
|
||||
message =
|
||||
sinkType.getDescription() + "\n" +
|
||||
// Extract the needed metadata for this endpoint.
|
||||
|
||||
Reference in New Issue
Block a user