Skip to content

[P1] limit query param not validated — unhandled ValueError → 500 #7

Description

@ShadowWalkerNC

Summary

In api_post_history:

limit = min(int(request.args.get('limit', 20)), 100)

Passing ?limit=abc throws an unhandled ValueError, resulting in a 500 error.

Fix

try:
    limit = min(int(request.args.get('limit', 20)), 100)
except (ValueError, TypeError):
    limit = 20

Effort: ~15 minutes

Part of full audit: #1

Activity

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

    P1bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions