Skip to content

Potential fix for code scanning alert no. 77: Missing rate limiting#112

Merged
utsavjosh1 merged 1 commit into
mainfrom
alert-autofix-77
Apr 29, 2026
Merged

Potential fix for code scanning alert no. 77: Missing rate limiting#112
utsavjosh1 merged 1 commit into
mainfrom
alert-autofix-77

Conversation

@utsavjosh1

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/utsavjosh1/Postly/security/code-scanning/77

Add an Express rate-limiting middleware and apply it before authenticateToken so abusive traffic is throttled before auth/controller execution.

Best single fix in this file:

  1. Import express-rate-limit.
  2. Define a limiter instance (for example, 100 requests per 15 minutes per IP).
  3. Register the limiter on the router with router.use(...) before router.use(authenticateToken).

This preserves existing route behavior while adding a protective throttle for all Discord routes in apps/api/src/routes/discord.routes.ts.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Apr 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
postly-web Ready Ready Preview, Comment Apr 28, 2026 5:33pm

@utsavjosh1 utsavjosh1 marked this pull request as ready for review April 29, 2026 10:15
@utsavjosh1 utsavjosh1 merged commit 4bd887a into main Apr 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant