Skip to content

fix(security): add auth, rate limiting, and input sanitization to client-error endpoint - #2375

Open
ionfwsrijan wants to merge 5 commits into
gopaljilab:mainfrom
ionfwsrijan:fix/issue-2349-client-error-auth-rate-limit
Open

fix(security): add auth, rate limiting, and input sanitization to client-error endpoint#2375
ionfwsrijan wants to merge 5 commits into
gopaljilab:mainfrom
ionfwsrijan:fix/issue-2349-client-error-auth-rate-limit

Conversation

@ionfwsrijan

Copy link
Copy Markdown
Contributor

Summary

Fixes #2349 — The /api/logs/client-error endpoint was unauthenticated,
rate-limit-free, and accepted arbitrary input, making it exploitable for log
injection and DoS attacks.

Changes

  • server/routes.ts: Added requireAuth middleware, rate limiting (10
    requests/minute), and input sanitization (strip control characters, truncate)
    to the client error endpoint.

Testing

  • Verified unauthenticated requests receive 401.
  • Verified rate limiting kicks in after 10 requests/minute.
  • Verified control characters are stripped from error messages.

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

@ionfwsrijan is attempting to deploy a commit to the gopaljilab's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the type:bug Something isn't working or throwing errors. label Jul 13, 2026
- Fix translation.json missing comma after myHealth section (blocked 18 client test suites)
- Fix access-audit.test.ts: update assertion to match implementation 'PHI Access Granted'
- Fix fileValidation.ts: swap extension check before MIME check to match test expectations
- Fix batchAuthMiddleware.ts: check emailVerified instead of verified to match session shape
- Fix batchAuthMiddleware.test.ts: update mock session to use emailVerified
@github-actions github-actions Bot added the type:security Vulnerability fixes or security-related enhancements. label Jul 13, 2026
@ionfwsrijan

Copy link
Copy Markdown
Contributor Author

@gopaljilab Please review this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working or throwing errors. type:security Vulnerability fixes or security-related enhancements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Unauthenticated Client Error Logging Endpoint Enables Log Injection, Stored XSS, and DoS

1 participant