Skip to content

Add server-side file size validation to OCR agent to prevent DoS - #2

Open
nimishlohia wants to merge 1 commit into
QubridAI-Inc:mainfrom
nimishlohia:fix-ocr-file-size-validation
Open

Add server-side file size validation to OCR agent to prevent DoS#2
nimishlohia wants to merge 1 commit into
QubridAI-Inc:mainfrom
nimishlohia:fix-ocr-file-size-validation

Conversation

@nimishlohia

@nimishlohia nimishlohia commented May 5, 2026

Copy link
Copy Markdown

🚀 Fix: Server-Side File Size Validation for OCR Upload

Problem

The OCR agent did not enforce a server-side file size limit. This could allow large file uploads, leading to excessive memory usage and potential Denial of Service (DoS).

Solution

  • Added a file size validation check (10MB limit) in Agents/OCR_Multilingual_Translation_Agent/app.py
  • Prevents processing of large files before OCR pipeline execution
  • Displays an error message if file exceeds limit

Impact

  • Improves application stability
  • Prevents resource exhaustion
  • Enhances security

Testing

  • ✅ Small files (<10MB) are processed successfully
  • ❌ Large files (>10MB) are rejected with an error message

Closes #1

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.

[Security] Add Server-Side File Size Validation to OCR Agent to Prevent DoS

1 participant