Skip to content

Missing upper bound validation for --limit in spot history #22

Description

@MayurK-cmd

The spot history command accepts a --limit option but only validates the lower bound (limit > 0). According to the API documentation, the maximum allowed limit is 15. Currently, users can pass --limit 1000 which may cause silent failures or unexpected API behavior.

Expected behavior:

  • Accept --limit values from 1 to 15
  • Throw clear error if user exceeds 15

Current behavior:

  • Accepts any positive integer without upper bound check

Location: src/commands/SpotCommand.ts:612-615

Suggested fix:
const limit = Number(opts.limit); if (isNaN(limit) || limit <= 0 || limit > 15) { throw new Error("--limit must be between 1 and 15."); }

Type: Bug - Input Validation

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions