Availability: JSON DoS Vulnerability:An attacker sends a very large JSON message (like 100MB) to the server.#89
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@imxade Please merge this fix , Let me know if any issue |
Addressed Issues:
Closes #88
Why need fix:
An attacker sends a very large JSON message (like 100MB) to the server.
The server tries to parse it immediately on the main thread, which takes a long time and blocks everything else.
During that time, no other users can use the system, causing a Denial of Service.
Issue: JSON.parse(raw) is called on the main thread without checking payload size.
Fix: Check data.length before parsing and reject messages larger than a specific limit (e.g., 10KB).
Why?: An attacker can send a massive JSON string (e.g., 100MB), causing the single-threaded server to freeze while parsing it (Denial of Service).
Checklist
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.