Skip to content

[Fix] rate limiting not applied to GET /vaults and GET /positions Vercel handlers #176

Closed

Description

@collinsezedike

Problem

checkRateLimit is only applied in the four /tx/ Vercel handlers (deposit, withdraw, add-trustline, submit). The GET /api/v1/vaults and GET /api/v1/positions/:publicKey handlers have no rate limiting, even though they trigger DeFiLlama HTTP fetches and Stellar RPC calls respectively. A scraper or accidental polling loop could exhaust upstream rate limits.

The Fastify layer has a global @fastify/rate-limit that covers all routes; the Vercel layer does not.

Fix

Add if (!checkRateLimit(req, res)) return; at the top of the vaults and positions Vercel handlers, consistent with the tx handlers.

Files affected

  • api/v1/vaults/index.ts
  • api/v1/vaults/[vaultId].ts
  • api/v1/positions/[publicKey].ts

Activity

  1. added
    mediumRequires familiarity with the Meridian codebase or relevant tooling; expect 4–8 hours
    apiAdds or modifies a REST endpoint in apps/api
    securitySecurity hardening, vulnerability fixes, or audit-related work
    on Jun 21, 2026
  2. changed the title [-]fix: rate limiting not applied to GET /vaults and GET /positions Vercel handlers[/-] [+][Fix] rate limiting not applied to GET /vaults and GET /positions Vercel handlers[/+] on Jun 21, 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

    apiAdds or modifies a REST endpoint in apps/apimediumRequires familiarity with the Meridian codebase or relevant tooling; expect 4–8 hourssecuritySecurity hardening, vulnerability fixes, or audit-related work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions