Skip to content

@Throttle silently skips rate limiting when clientID is 0 #62

@dnocturne

Description

@dnocturne

@Throttle guards its rate-limit logic with if (player?.clientID). On RageMP the first player to connect has clientID: 0, which is falsy, so the entire rate-limit block is skipped.

There is no error and no warning. The handler runs unthrottled. The first player effectively has no rate limit on any @Throttle-decorated method until they reconnect with a non-zero ID.

This is the same root cause as the @Guard bug #61 but the impact is a silent security regression rather than a visible failure.

Steps to reproduce

  1. Define a throttled handler:

    @Command('spam')
    @Throttle(1, 5000) // 1 call per 5s
    spamCommand(player: Player) {
      player.send('ran')
    }
  2. Start a fresh RageMP server.

  3. Join as the first player (clientID === 0).

  4. Spam /spam repeatedly.

Expected

Calls beyond the limit are blocked with a SecurityError.

Actual

Every call goes through. The rate limiter is never consulted.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions