Attackathon _ Fuel Network 32491 - [Smart Contract - Low] Incorrect PushA PopA Mask Calculation
Description
Brief/Intro
Vulnerability Details
let reg = match &op.opcode {
Either::Right(ControlFlowOp::PushAll(label)) => {
active_sets.insert(*label);
None
}
Either::Right(ControlFlowOp::PopAll(label)) => {
active_sets.swap_remove(label);
None
}
Either::Left(alloc_op) => alloc_op.def_registers().into_iter().next(),
Either::Right(ctrl_op) => ctrl_op.def_registers().into_iter().next(),
};
if let Some(reg) = reg {
for active_label in active_sets.clone() {
reg_sets
.entry(active_label)
.and_modify(|regs: &mut BTreeSet<AllocatedRegister>| {
regs.insert(reg.clone());
})
.or_insert_with(|| {
BTreeSet::from_iter(std::iter::once(reg).cloned())
});
}
}
Impact Details
References
Proof of concept
Proof of Concept
PreviousAttackathon _ Fuel Network 32486 - [Blockchain_DLT - Medium] Public RPC node craches via GraphQL APINextAttackathon _ Fuel Network 32536 - [Smart Contract - Insight] The control flow graph is incorrectly
Last updated
Was this helpful?