Add tests for jinja

This commit is contained in:
Joe Farebrother
2024-11-20 14:50:35 +00:00
parent 71ab82dee0
commit 1cb01a286d
4 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
/**
* @name Server Side Template Injection
* @description Using user-controlled data to create a template can lead to remote code execution or cross site scripting.
* @kind path-problem
* @problem.severity error
* @precision high
* @id py/template-injection
* @tags security
* external/cwe/cwe-074
*/
import python
import semmle.python.security.dataflow.TemplateInjectionQuery
import TemplateInjectionFlow::PathGraph
from TemplateInjectionFlow::PathNode source, TemplateInjectionFlow::PathNode sink
where TemplateInjectionFlow::flowPath(source, sink)
select sink.getNode(), source, sink, "This Template construction depends on $@.", source.getNode(),
"user-provided value"