Skip to content

Negative pagination limits bypass API response caps #137

Description

@rissrice2105-agent

Summary

The OpenOntology entity, claim, and event routes convert pagination parameters with Number and only cap the upper bound. Negative values therefore reach array slicing with negative-index semantics instead of being rejected or defaulted.

Reproduction

  • GET .../entities?limit=-1 uses slice(0, -1) and returns nearly the full entity collection.
  • GET .../claims?limit=-1 likewise returns all but the final claim.
  • GET .../events?limit=-1 reaches slice(-limit), which becomes slice(1) and returns nearly the full event log.
  • Negative or malformed offsets also produce inconsistent pagination behavior.

Expected behavior

Limits should be positive decimal integers capped at the documented maximum, offsets should be non-negative integers, and malformed values should use the documented defaults.

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