Skip to content

fix: add max port range validation to prevent DoS scans#319

Closed
Midoriya-w wants to merge 5 commits into
utksh1:mainfrom
Midoriya-w:fix-port-range-dos
Closed

fix: add max port range validation to prevent DoS scans#319
Midoriya-w wants to merge 5 commits into
utksh1:mainfrom
Midoriya-w:fix-port-range-dos

Conversation

@Midoriya-w
Copy link
Copy Markdown
Contributor

📌 Overview

Added validation limits for port ranges to prevent excessively large scans that could cause resource exhaustion and denial of service.

🛠 Type of Change

  • Backend
  • Security Fix

✨ Changes Made

  • Added maximum allowed port range validation
  • Prevented scans like 1-65535 from being accepted
  • Added configurable limit using settings.max_port_range_size
  • Improved validation error handling
  • Reduced risk of CPU and network resource exhaustion

🔗 Related Issue

Closes #308

@utksh1 utksh1 added area:backend Backend API, database, or service work area:security Security-sensitive implementation or tests area:docs Documentation or contributor guide work type:security Security work category bonus label type:bug Bug fix work category bonus label type:docs Documentation work category bonus label level:intermediate 35 pts difficulty label for moderate contributor PRs gssoc:invalid Admin validation: invalid for GSSoC scoring gssoc:ai-slop Admin validation: low-quality AI-generated submission labels May 26, 2026
@utksh1
Copy link
Copy Markdown
Owner

utksh1 commented May 26, 2026

Closing as invalid/low-quality. This duplicates #316/#317 work, is already conflicting, introduces a typo in config.py (manFagement), repeats comments, and changes valid port-range tests to fit the new limit instead of proving the limit safely. Labeled gssoc:invalid and gssoc:ai-slop.

@utksh1 utksh1 closed this May 26, 2026
@Midoriya-w
Copy link
Copy Markdown
Contributor Author

Understood @utksh1 . Thanks for the feedback. I’ll keep future PRs smaller, avoid bundling unrelated changes, and ensure all commands/examples are repo-supported before submitting again.

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

Labels

area:backend Backend API, database, or service work area:docs Documentation or contributor guide work area:security Security-sensitive implementation or tests gssoc:ai-slop Admin validation: low-quality AI-generated submission gssoc:invalid Admin validation: invalid for GSSoC scoring level:intermediate 35 pts difficulty label for moderate contributor PRs type:bug Bug fix work category bonus label type:docs Documentation work category bonus label type:security Security work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] [Security] validate_port_range() has no upper limit on range size DoS via 1-65535 scan

2 participants