Skip to content

fix: enforce allowlist enum on transitionType in WebSocket messages (closes #67)#73

Open
LucasMaupin wants to merge 1 commit into
mainfrom
fix/issue-67-transitiontype-enum
Open

fix: enforce allowlist enum on transitionType in WebSocket messages (closes #67)#73
LucasMaupin wants to merge 1 commit into
mainfrom
fix/issue-67-transitiontype-enum

Conversation

@LucasMaupin

Copy link
Copy Markdown
Collaborator

Summary

Replaces the permissive z.string().max(32) validator on transitionType in TRANSITION and TAKE WebSocket messages with a strict z.enum([...]) containing all valid Strom transition names.

What changed:

  • Added TransitionTypeSchema (Zod enum) in src/ws/controller.ts listing all valid Strom transition types
  • TRANSITION message: transitionType now must be one of the known enum values
  • TAKE message: transitionType (optional) now must be one of the known enum values when provided

Arbitrary strings can no longer reach the Strom pipeline API via the WebSocket handler. Any client sending an unrecognised transition type will receive a validation error before the message is forwarded to Strom.

Closes #67

…loses #67)

Replaces the permissive z.string().max(32) validator on transitionType in
TRANSITION and TAKE messages with a strict z.enum([...]) containing all
valid Strom transition names. Arbitrary strings can no longer reach the
Strom pipeline API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SECURITY][MEDIUM] WebSocket SET_TRANSITION accepts arbitrary free-form transitionType string — no allowlist enforced

1 participant