Source是上一个Flow的Sink

    https://github.com/github/codeql/issues?q=MyBatis+

    https://github.com/github/codeql/issues/6230

    CodeQL只支持在使用org.apache.ibatis.jdbc.SqlRunner操作SQL语句时产生的SQL注入问题。
    image.png

    https://codeql.github.com/codeql-standard-libraries/java/semmle/code/xml/XML.qll/type.XML$XMLFile.html

    mapper.xml语句包含其他的XMLElement
    https://github.com/github/codeql/pull/6411

    定位Mapper.xml文件
    image.png

    1. import java
    2. from XMLFile mapperXML
    3. where mapperXML.getRelativePath().matches("%/resources/%")
    4. select mapperXML

    TODO:难题
    image.png
    当查询语句里面包含include语句时,进入到相应的sql中,当sql里面拼接了参数时,则认为目标查询语句存在SQL注入漏洞

    在输出时利用$@输出查询语句对应的XML元素