Skip to content

[SECURITY] Add Input Validation to Prevent DoS Attacks #991

Description

@Aharshi3614

Problem Statement

The prediction API currently accepts text of unlimited length, making it vulnerable to Denial-of-Service (DoS) attacks. An attacker could send a massive text payload (e.g., 10MB of random characters) causing the ML model to consume excessive CPU/memory, potentially crashing the server.

Proposed Solution

Implement strict input validation for all API endpoints:

Maximum text length: 5000 characters

Maximum request size: 1MB

Rate limiting per IP

Early validation before expensive ML operations

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