π‘οΈ Sentinel: [Security Enhancement] Add input length limits to prevent DoS#30
π‘οΈ Sentinel: [Security Enhancement] Add input length limits to prevent DoS#30kingkillery wants to merge 1 commit into
Conversation
Co-authored-by: kingkillery <200727508+kingkillery@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 59 minutes and 9 seconds. β 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. βΉοΈ Review infoβοΈ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: π Files selected for processing (4)
β¨ 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 |
π¨ Severity: MEDIUM
π‘ Vulnerability: Missing input length limits on the
image_sizeparameter incommonforms/inference.py. If a malicious or malformed input provided an extremely largeimage_size(e.g., billions), it could lead to memory exhaustion and a Denial of Service (DoS) when passed to the YOLO model.π― Impact: An attacker could crash the application or exhaust system memory by providing an extremely large image size parameter.
π§ Fix: Added a maximum boundary
IMAGE_SIZE_MAX: int = 4096incommonforms/config.py. Updated_validate_inputsincommonforms/inference.pyto enforce thatimage_sizeis between the minimum and maximum boundaries. UpdatedInvalidImageSizeErrorincommonforms/exceptions.pyto correctly report the boundary limits. Also fixed a pre-existing minor linting issue (unnecessary f-string) indataset/split_dataset.py.β Verification: Ran
uv run pytest tests/to verify tests pass anduv run ruff check commonforms/ tests/ dataset/to verify linting.PR created automatically by Jules for task 541704117853209818 started by @kingkillery