fix(blocks): add limits to loop block to prevent disk exhaustion

- n_loops: max 10 loops
- duration: max 1 hour (3600s)

Prevents DoS via unbounded video generation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Nicholas Tindle
2026-02-04 22:49:13 -06:00
parent 2602913f7d
commit 14e73b793a

View File

@@ -29,11 +29,13 @@ class LoopVideoBlock(Block):
description="Target duration (in seconds) to loop the video to. If omitted, defaults to no looping.",
default=None,
ge=0.0,
le=3600.0, # Max 1 hour to prevent disk exhaustion
)
n_loops: Optional[int] = SchemaField(
description="Number of times to repeat the video. If omitted, defaults to 1 (no repeat).",
default=None,
ge=1,
le=10, # Max 10 loops to prevent disk exhaustion
)
class Output(BlockSchemaOutput):