-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Missing Input Validation
Priority: P1 - High
Estimate: 3 hours
Review Reference: REVIEW.md (P1-1)
Issue
Several input validation gaps exist:
-
CIDR Validation Incomplete (
internal/http/server.go:829-837)- Doesn't check for reserved ranges (0.0.0.0/8, 127.0.0.0/8, 240.0.0.0/4)
- No broadcast address checks
- No maximum prefix length constraints
-
Account Key Not Validated (
internal/http/server.go:544-549)- No format validation (should match pattern like "aws:123456789012")
- No length constraints
- No character whitelist
-
Name Field Length Not Constrained
- Pool names and account names have no max length
- Could lead to storage/display issues
Impact: Medium - Could allow invalid data into system
Solution
Create internal/validation package with:
ValidateCIDR()- check reserved ranges, format, constraintsValidateAccountKey()- format, length, character validationValidateName()- length constraints, non-empty check
See REVIEW.md (P1-1) for complete implementation.
Acceptance Criteria
- validation package created with comprehensive checks
- CIDR validation rejects reserved ranges
- Account key validation enforces pattern and length
- Name validation enforces max length
- All validators have unit tests
- Handlers updated to use validators
- Error messages are descriptive