Skip to content

Commit 4419540

Browse files
author
Gemini Agent
committed
Reduce MAX_PLAN_BYTES to 256 KiB to prevent potential DoS
1 parent ab095bd commit 4419540

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

rust/src/fvm/machine.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,9 @@ fn FVM_BeginReservations(
614614
return FvmReservationStatus::Ok;
615615
}
616616

617-
// Enforce a maximum encoded plan size (8 MiB).
618-
const MAX_PLAN_BYTES: usize = 8 * 1024 * 1024;
617+
// Enforce a maximum encoded plan size (256 KiB).
618+
// This is based on a maximum of 4096 entries at 64 bytes per entry.
619+
const MAX_PLAN_BYTES: usize = 256 * 1024;
619620
if cbor_plan_len > MAX_PLAN_BYTES {
620621
set_reservation_error_message_out(
621622
error_msg_ptr_out,

0 commit comments

Comments
 (0)