-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @name Untrusted data passed to external API | ||
* @description Data provided remotely is used in this external API without sanitization, which could be a security risk. | ||
* @id java/untrusted-data-to-external-api | ||
* @kind path-problem | ||
* @precision low | ||
* @problem.severity error | ||
* @security-severity 7.8 | ||
* @tags security external/cwe/cwe-20 | ||
*/ | ||
|
||
import java | ||
import semmle.code.java.dataflow.FlowSources | ||
import semmle.code.java.dataflow.TaintTracking | ||
import semmle.code.java.security.ExternalAPIs | ||
import UntrustedDataToExternalApiFlow::PathGraph | ||
|
||
from UntrustedDataToExternalApiFlow::PathNode source, UntrustedDataToExternalApiFlow::PathNode sink | ||
where UntrustedDataToExternalApiFlow::flowPath(source, sink) | ||
select sink, source, sink, | ||
"Call to " + sink.getNode().(ExternalApiDataNode).getMethodDescription() + | ||
" with untrusted data from $@.", source, source.toString() |