Network Scanner Review - Issue Index
Quick Navigation
🔴 CRITICAL ISSUES (22 total)
🟡 WARNINGS (28 total)
🟢 IMPROVEMENTS (15 total)
CRITICAL ISSUES
Backend Critical
| # |
Issue |
File |
Severity |
Status |
| 1.2 |
Database session leaks in background tasks |
app/api/endpoints/scans.py:33-41 |
BLOCKER |
❌ MUST FIX |
| 1.4 |
WebSocket not connected to scan execution |
app/services/scan_service.py |
BLOCKER |
❌ MUST FIX |
| 1.5 |
No error handling for empty scan results |
app/scanner/network_scanner.py:88-95 |
BLOCKER |
❌ MUST FIX |
| 1.7 |
Invalid port range parsing crashes |
app/scanner/port_scanner.py:143-157 |
BLOCKER |
❌ MUST FIX |
| 1.8 |
Thread-unsafe WebSocket connection manager |
app/api/endpoints/websocket.py:20-33 |
BLOCKER |
❌ MUST FIX |
| 1.9 |
Active scans dict never cleaned up |
app/services/scan_service.py:20 |
BLOCKER |
❌ MUST FIX |
| 1.10 |
No check for OS detection privilege requirements |
app/scanner/nmap_scanner.py:84 |
BLOCKER |
⚠️ SHOULD FIX |
Frontend Critical
| # |
Issue |
File |
Severity |
Status |
| 1.11 |
Missing Service model fields |
frontend/src/types/api.ts:12-23 |
BLOCKER |
❌ MUST FIX |
| 1.12 |
Host status type mismatch |
frontend/src/types/api.ts:5-11 |
BLOCKER |
❌ MUST FIX |
| 1.13 |
Topology neighbors endpoint type error |
frontend/src/services/api.ts:76 |
BLOCKER |
❌ MUST FIX |
| 1.14 |
Scan field name mismatch |
frontend/src/types/api.ts:27 |
BLOCKER |
❌ MUST FIX |
| 1.15 |
Dependencies not installed |
frontend/package.json |
BLOCKER |
❌ MUST FIX |
| 1.16 |
Frontend env vars not defined |
frontend/src/services/api.ts |
BLOCKER |
❌ MUST FIX |
Common Critical
| # |
Issue |
File |
Severity |
Status |
| 1.17 |
No input validation on network range |
app/scanner/network_scanner.py:55 |
BLOCKER |
⚠️ SHOULD FIX |
| 1.18 |
No rate limiting on endpoints |
app/api/endpoints/scans.py |
SECURITY |
❌ MUST FIX |
| 1.19 |
No authentication/authorization |
main.py, all endpoints |
SECURITY |
❌ MUST FIX |
| 1.20 |
Database file permissions not set |
app/database.py |
SECURITY |
⚠️ SHOULD FIX |
| 1.21 |
Subprocess command injection risk |
app/scanner/network_scanner.py:173-181 |
SECURITY |
⚠️ SAFE BUT CHECK |
| 1.22 |
No security logging |
All modules |
SECURITY |
⚠️ SHOULD FIX |
WARNINGS
Backend Warnings
| # |
Issue |
File |
Line |
Priority |
| 2.1 |
Hostname resolution could hang |
app/scanner/network_scanner.py |
191 |
Medium |
| 2.2 |
Banner grabbing timeout not set |
app/scanner/service_detector.py |
50-61 |
Medium |
| 2.3 |
Nmap parsing missing edge cases |
app/scanner/nmap_scanner.py |
80-110 |
Medium |
| 2.4 |
Connection detection too simplistic |
app/services/scan_service.py |
275-315 |
Low |
| 2.5 |
Topology generation could timeout |
app/services/topology_service.py |
43-60 |
Medium |
| 2.6 |
Port lists hardcoded not configurable |
app/scanner/network_scanner.py |
20 |
Low |
| 2.7 |
Scan type validation incomplete |
app/schemas.py |
8-11 |
Low |
| 2.8 |
No check for conflicting concurrent scans |
app/services/scan_service.py |
- |
Medium |
| 2.9 |
WebSocket message size not limited |
app/api/endpoints/websocket.py |
- |
Medium |
| 2.10 |
Async context issues in callbacks |
app/services/scan_service.py |
302-322 |
Medium |
Frontend Warnings
| # |
Issue |
File |
Line |
Priority |
| 2.11 |
API error handling incomplete |
frontend/src/services/api.ts |
- |
Medium |
| 2.12 |
WebSocket reconnection could be better |
frontend/src/services/websocket.ts |
65-75 |
Low |
| 2.13 |
Unused imports not caught |
Multiple files |
- |
Low |
| 2.14 |
Missing PropTypes validation |
All React components |
- |
Low |
| 2.15 |
No rate limit error feedback |
Frontend services |
- |
Low |
Security & Database Warnings
| # |
Issue |
File |
Category |
Priority |
| 2.16 |
No database migrations |
app/database.py |
DB |
High |
| 2.17 |
SQLite not production-ready |
app/config.py |
DB |
High |
| 2.18 |
No backup strategy |
- |
DB |
High |
| 2.19 |
CORS too permissive |
main.py:41-46 |
Security |
High |
| 2.20 |
No HTTPS enforcement |
main.py |
Security |
High |
| 2.21 |
Missing security headers |
main.py |
Security |
High |
| 2.22 |
Debug mode enabled by default |
.env.example:8 |
Security |
High |
| 2.23 |
No secrets management |
- |
Security |
High |
| 2.24 |
No CSRF protection |
main.py |
Security |
High |
| 2.25 |
Subprocess calls error handling |
app/scanner/network_scanner.py:173 |
Security |
Medium |
| 2.26 |
Custom ports not validated |
app/schemas.py |
Validation |
Medium |
| 2.27 |
No request size limiting |
main.py |
Security |
Medium |
| 2.28 |
Logs may contain sensitive data |
All modules |
Security |
Low |
IMPROVEMENTS
Code Quality (3.1-3.5)
| # |
Issue |
Current |
Recommended |
Effort |
| 3.1 |
Docstrings incomplete |
Partial |
Complete with examples |
2hrs |
| 3.2 |
Type hints missing |
~80% |
100% with mypy strict |
3hrs |
| 3.3 |
Magic numbers scattered |
Various |
Extract to constants |
1hr |
| 3.4 |
Config not structured |
Strings |
Dataclasses/enums |
2hrs |
| 3.5 |
Separation of concerns |
Mixed |
Better module division |
3hrs |
Testing (3.6-3.10)
| # |
Issue |
Current |
Recommended |
Effort |
| 3.6 |
Unit tests |
Basic |
Comprehensive scanner tests |
4hrs |
| 3.7 |
Integration tests |
None |
API integration suite |
4hrs |
| 3.8 |
E2E tests |
None |
Full workflow tests |
6hrs |
| 3.9 |
Performance tests |
None |
Load testing suite |
3hrs |
| 3.10 |
Security tests |
None |
OWASP/security tests |
4hrs |
Documentation (3.11-3.15)
| # |
Issue |
Current |
Recommended |
Effort |
| 3.11 |
API docs |
Auto-generated |
Add examples |
2hrs |
| 3.12 |
Architecture docs |
Text only |
Add diagrams |
2hrs |
| 3.13 |
Troubleshooting |
Basic |
Comprehensive guide |
3hrs |
| 3.14 |
Performance tuning |
None |
Optimization guide |
2hrs |
| 3.15 |
Deployment |
None |
Docker/K8s guides |
4hrs |
ISSUE STATISTICS
By Severity
By Component
By Category
QUICK FIX ROADMAP
Phase 1: CRITICAL (2-3 hours)
These MUST be fixed for tool to work at all:
- ✅ Frontend npm install
- ✅ Frontend type definitions
- ✅ Database session handling
- ✅ WebSocket integration
- ✅ WebSocket thread safety
- ✅ Frontend env vars
Phase 2: HIGH (4-5 hours)
These should be fixed for reliable operation:
- Authentication/Authorization
- Rate limiting
- Input validation
- Error handling
- Security headers
Phase 3: MEDIUM (6-8 hours)
These improve production readiness:
- Database migration
- HTTPS/SSL
- Monitoring/logging
- Configuration management
- Backup strategy
Phase 4: LOW (10+ hours)
These improve quality:
- Comprehensive tests
- Performance optimization
- Documentation
- Deployment automation
FILE-BY-FILE IMPACT ANALYSIS
MUST MODIFY
SHOULD MODIFY
SHOULD CREATE
TESTING VALIDATION
After implementing fixes, verify with:
REFERENCE: Backend Models
Current Models
Scan: Scan operations
Host: Discovered hosts
Service: Open ports/services
Connection: Host relationships
Missing Models
User: Authentication
ScanTemplate: Saved scan configs
Notification: Alerts
Audit: Security logging
NOTES FOR DEVELOPER
- Database Session Pattern: Always create fresh sessions for background tasks
- WebSocket Design: Broadcast events from central manager
- Type Safety: Ensure frontend types match backend response schemas
- Async/Await: Be careful mixing sync/async code
- Error Messages: User-friendly, not technical dumps
- Security First: Validate all inputs, check permissions
- Logging: Log actions for security/debugging
Generated: December 4, 2025