decentraland / decentraland/Pulse
Validate EmoteStart.emote_id server-side (length, whitespace, control characters)
- Dominant language
- C#
- Stars
- 0
- Forks
- 1
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 5
Description
`FieldValidator.ValidateEmoteStart` checks an `EmoteStart`'s duration, `player_state` and parcel, but not `emote_id`. The id is relayed verbatim to every observer in the subject's interest set, and to scene listeners once #43 lands, and a scene ultimately sees it as the `emote_urn` of an `AvatarEmoteCommand` entry. A rogue client can therefore push an arbitrary string, of any length the transport allows, into every nearby client's and server's scene crdt on each emote start.
bevy-explorer decentraland/bevy-explorer#1227 drops such emotes at its wire boundary (empty, over 256 bytes, or containing whitespace or control characters), but that only protects bevy clients and servers; unity and any other observer still receive them, and the server is the right place to stop them once for everyone.
Suggested rule, matching the client-side one so the two agree: reject (`INVALID_EMOTE_FIELD`) an `EmoteStart` whose `emote_id` is empty, longer than 256 bytes, or contains whitespace or control characters. A scene-emote urn (`urn:decentraland:off-chain:scene-emote:--`) is the longest legitimate form and fits comfortably.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Contributor guide
Research direction
Start at FieldValidator.ValidateEmoteStart and review the existing duration, player_state, and parcel checks. Implement the stated emote_id rule and INVALID_EMOTE_FIELD rejection for empty values, values over 256 bytes, or values containing whitespace or control characters; done means invalid EmoteStart messages are rejected consistently with the client-side rule.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100