Attackathon _ Fuel Network 33444 - [Smart Contract - Insight] Sway compiler crash for access out-of-
Description
Brief/Intro
Vulnerability Details
fn type_check_encode_append(
handler: &Handler,
mut ctx: TypeCheckContext,
kind: sway_ast::Intrinsic,
arguments: &[Expression],
_type_arguments: &[TypeArgument],
span: Span,
) -> Result<(ty::TyIntrinsicFunctionKind, TypeId), ErrorEmitted> {
let type_engine = ctx.engines.te();
let engines = ctx.engines();
let buffer_type = type_engine.insert(engines, encode_buffer_type(engines), None);
let buffer_expr = {
let ctx = ctx
.by_ref()
.with_help_text("")
.with_type_annotation(buffer_type);
ty::TyExpression::type_check(handler, ctx, &arguments[0])?
};
let item_span = arguments[1].span.clone(); // [1] no arguments length check before access. This leads to the out-of-bound vector accessImpact Details
References
Proof of concept
Proof of Concept
PreviousAttackathon _ Fuel Network 33433 - [Smart Contract - Low] Self-append in Bytes data structure causesNextAttackathon _ Fuel Network 33450 - [Blockchain_DLT - Insight] fuel_gas_price_algorithm AlgorithmV ma
Last updated
Was this helpful?