Example
0x01 Getting Started
import java
from IfStmt ifStmt, BlockStmt block
where
block = ifStmt.getThen() and
block.getNumStmt() = 0
select ifStmt, "This isf-statement has an empty then-block"import java
predicate isEmpty(BlockStmt block) {
block.getNumStmt() = 0
}
from IfStmt ifStmt
where
isEmpty(ifStmt.getThen())
select ifStmt0x02 Apprentice Lab
Finding XML deserialization
Find the implementations of the toObject method from ContentTypeHandler
Unsafe XML deserialization

0x03 CodeQL Recipe for Java
RefType
Method
Last updated