Skip to content

[BUG] Single Embed Endpoint Has No Text Length Validation #185

@EnthusiasticTech

Description

@EnthusiasticTech

Project

vgrep

Description

The /embed endpoint in api.rs accepts EmbedRequest with a single text field but has no validation on text length. A single request with gigabytes of text could exhaust server memory.

Error Message

Debug Logs

System Information

Bounty Version: 0.1.0
OS: Ubuntu 24.04 LTS
CPU: AMD EPYC-Genoa Processor (8 cores)
RAM: 15 GB

Screenshots

No response

Steps to Reproduce

  1. Start vgrep server
  2. Send: curl -X POST http://localhost:7777/embed -d '{"text":"A"*10000000000}'
  3. Server attempts to process, exhausting memory

Expected Behavior

Request rejected if text exceeds reasonable limit

Actual Behavior

Any text size accepted

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginvalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions