Fix UnicodeDoS vulnerability in CWE-770 code

This commit is contained in:
Sim4n6
2024-03-12 21:09:10 +00:00
committed by yoff
parent 085d803b14
commit af19a0342e

View File

@@ -61,15 +61,15 @@ predicate underAValue(DataFlow::GuardNode g, ControlFlowNode node, boolean branc
branch = true and
cn.operands(_, op_gt, n.asCfgNode())
or
// not arg <= LIMIT OR not arg < LIMIT
(op_lt = any(LtE lte) or op_lt = any(Lt lt)) and
branch = false and
cn.operands(n.asCfgNode(), op_lt, _)
or
// not LIMIT >= arg OR not LIMIT > arg
// not arg >= LIMIT OR not arg > LIMIT
(op_gt = any(GtE gte) or op_gt = any(Gt gt)) and
branch = false and
cn.operands(_, op_gt, n.asCfgNode())
cn.operands(n.asCfgNode(), op_gt, _)
or
// not LIMIT <= arg OR not LIMIT < arg
(op_lt = any(LtE lte) or op_lt = any(Lt lt)) and
branch = false and
cn.operands(_, op_lt, n.asCfgNode())
)
|
lenCall = API::builtin("len").getACall() and