Skip to content

[Security] H-02: Plugin rate limiter memory leak — no cleanup of stale entries #46

Description

@xdevrobot

Severity: HIGH — Resource Exhaustion / DoS

File: src/bot/rate-limiter.ts

The PluginRateLimiter stores timestamps per plugin:action key with no TTL or periodic cleanup. Under sustained load from many unique plugin/action combinations, memory grows unbounded.

Impact: Memory exhaustion under sustained or deliberate high-volume traffic. An attacker can create many unique keys to force unbounded growth.

Fix: Add a periodic cleanup interval (e.g., every 5 minutes) that removes entries older than the tracking window. Consider using a TTL-based Map or LRU cache.

Part of comprehensive security audit (issue #44).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions