Skip to content

enhancement: HTTP API needs max limit cap and content size validation #903

Closed

Description

@ajianaz

What

HTTP API accepts unlimited limit values and unbounded content sizes with no server-side cap.

Reproduction

# limit=999999 accepted — returns 2,137 results
curl -X POST http://localhost:18999/recall \
  -d '{"query":"memory","limit":999999}'
# Returns 2,137 results (all active memories). No cap enforced.

# 100KB content accepted for remember
python3 -c "print('A'*100000)" | curl -X POST http://localhost:18999/remember \
  -d "{\"content\":\"$(python3 -c 'print(\"A\"*100000)')\"}"
# Accepted — no size limit validation

Impact

  • DoS vector: Malicious client can request limit=999999 to dump entire DB
  • Memory exhaustion: Unbounded content sizes can fill disk
  • recall_unified() does cap at limit.min(50) (lib.rs:1643), but HTTP handler may bypass this

Proposed Fix

  1. Cap limit at server level (e.g., max 100)
  2. Cap content size at server level (e.g., max 32KB)
  3. Return 400 for requests exceeding limits

Environment

  • uteke-serve v0.12.0

Activity

  1. added
    enhancement
    priority:high
    scope:server
    on Aug 5, 2026
  2. added a commit that references this issue on Aug 6, 2026
  3. ajianaz commented on Aug 6, 2026

    @ajianaz
    CollaboratorAuthor

    Fixed in PR #911 (squash merged to develop). MAX_LIMIT=100 cap added to prevent unbounded queries.

  4. added a commit that references this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:highscope:server

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions