Attackathon _ Fuel Network 32973 - [Smart Contract - Medium] Impl block dependency overwriting
Description
Brief/Intro
Vulnerability Details
fn decl_name(engines: &Engines, decl: &Declaration) -> Option<DependentSymbol> {
let impl_sym = |trait_name, type_info: &TypeInfo, method_names| {
Some(DependentSymbol::Impl(
trait_name,
type_info_name(type_info),
method_names,
))
};
match decl {
// ...
Declaration::ImplSelf(decl_id) => {
let decl = engines.pe().get_impl_self(decl_id);
let trait_name = Ident::new_with_override("self".into(), decl.implementing_for.span());
impl_sym(
trait_name,
&type_engine.get(decl.implementing_for.type_id),
decl.items
.iter()
.map(|item| match item {
ImplItem::Fn(fn_decl_id) => {
let fn_decl = engines.pe().get_function(fn_decl_id);
fn_decl.name.to_string()
}
ImplItem::Constant(decl_id) => {
let const_decl = engines.pe().get_constant(decl_id);
const_decl.name.to_string()
}
ImplItem::Type(decl_id) => {
let type_decl = engines.pe().get_trait_type(decl_id);
type_decl.name.to_string()
}
})
.collect::<Vec<String>>()
.join(""),
)
}
}
}Impact Details
References
Proof of concept
Proof of Concept## Proof of Concept
PreviousAttackathon _ Fuel Network 32965 - [Blockchain_DLT - Critical] Messages to L included even on revertNextAttackathon _ Fuel Network 32978 - [Blockchain_DLT - Insight] isolating the node from the networkcau
Last updated
Was this helpful?