# Vulnerability Fixes Report **Project:** Eizen Email Service **Branch:** vulnerability-fix **Date:** 2026-02-05 **Source:** NeuroSploit Security Scan --- ## Summary | ✅ Fixed | ⏭️ Skipped | 🔴 False Positive | ⏳ Pending | |:--------:|:----------:|:-----------------:|:----------:| | 0 | 0 | 18 | 0 | --- ## Vulnerability Details | # | Title | Severity | CWE | File | Status | Reason | |---|-------|----------|-----|------|--------|--------| | 1 | Insecure Configuration of Content Security Policy | High (7.5) | CWE-74 | [main.py:41-47](src/main.py#L41-L47) | 🔴 False Positive | CSP already includes `'unsafe-inline'` for script-src and style-src. Scanner incorrectly parsed the header. | | 2 | Missing Rate Limiting | High (7.5) | CWE-338 | [main.py:51-76](src/main.py#L51-L76) | 🔴 False Positive | `RateLimitMiddleware` exists with per-IP sliding window. Enabled via `RATE_LIMIT=true` (default in prod). | | 3 | Missing HTTPS Redirect Middleware | High (7.5) | CWE-319 | [main.py:25-30](src/main.py#L25-L30) | 🔴 False Positive | `HTTPSRedirectMiddleware` exists (lines 25-30), registered when `HTTPS_ONLY=true` (line 108-109, default in prod). | | 4 | Insecure Configuration of Logger | High (7.5) | CWE-532 | [logger.py:12-18](src/config/logger.py#L12-L18) | 🔴 False Positive | File logging is opt-in (`LOG_TO_FILE=false` default). No sensitive data logged - only IPs, recipient emails, status messages. No passwords/API keys/body content logged. | | 5 | Missing Authentication for Sensitive Operations | High (7.5) | CWE-306 | [email_router.py:27-43](src/routers/email_router.py#L27-L43) | 🔴 False Positive | API key auth exists with `hmac.compare_digest()`. `/send-email/` requires `Security(verify_api_key)`. `API_AUTH=true` default in prod, exits if no keys set. | | 6 | Default Password Exposure | High (7.5) | CWE-522 | [input_classes.py:24-26](src/mapper_classes/input_classes.py#L24-L26) | 🔴 False Positive | `DEFAULT_PASSWORD` is from env var (not hardcoded). This is SMTP password for sending emails, not API auth. Password masked in JSON output. Env var required in prod. | | 7 | Insecure API Key Verification | High (7.5) | CWE-327 | [email_router.py:33-34](src/routers/email_router.py#L33-L34) | 🔴 False Positive | Scanner contradicts itself - recommends `hmac.compare_digest()` which is already used (line 34). Timing-attack safe comparison implemented. | | 8 | Missing Authentication for Sensitive Endpoint | High (7.5) | CWE-287 | [email_router.py:42-43](src/routers/email_router.py#L42-L43) | 🔴 False Positive | Duplicate of #5. Line 43 has `Security(verify_api_key)` dependency - FastAPI enforces auth before endpoint executes. | | 9 | Unvalidated File URL in Email Attachment | High (7.5) | CWE-494 | [send_email.py:35-67](src/core/send_email.py#L35-L67) | 🔴 False Positive | Full SSRF protection exists: scheme validation, host allowlist (`ALLOWED_MEDIA_HOSTS`), DNS resolution with private IP blocking, DNS rebinding prevention. | | 10 | Missing Auth for Sensitive Operations (test_send_mail.py) | High (9.8) | CWE-287 | unit_test/test_send_mail.py | 🔴 False Positive | **Test file** - not production code. Tests intentionally bypass/mock auth to test functionality. | | 11 | Missing Auth for Sensitive Operations (test_email_router.py) | High (7.5) | CWE-306 | unit_test/test_email_router.py | 🔴 False Positive | **Test file** - not production code. Tests use mock API keys to verify auth works. | | 12 | Insecure SSL Config (test_email_router.py) | High (5.9) | CWE-295 | unit_test/test_email_router.py | 🔴 False Positive | **Test file** - not production code. Test may disable SSL for testing scenarios. | | 13 | Insecure Rate Limiting (test_security_middleware.py) | High (7.5) | CWE-379 | unit_test/test_security_middleware.py | 🔴 False Positive | **Test file** - tests verify rate limiting works. Not production config. | | 14 | Insecure Env Vars (conftest.py) | High (7.5) | CWE-20 | unit_test/conftest.py | 🔴 False Positive | **Test file** - pytest fixtures set test env vars. Standard test practice, not runtime manipulation. | | 15 | Insecure File Upload Handling | Medium (6.5) | CWE-434 | [constants.py:127](src/config/constants.py#L127) | 🔴 False Positive | No file uploads exist - only URL downloads with SSRF protection. `ALLOWED_FILE_EXTENSIONS` validates attachment URLs, not uploads. | | 16 | Improper Error Handling (test_email_router.py) | Medium (4.3) | CWE-200 | unit_test/test_email_router.py | 🔴 False Positive | **Test file** - tests verify error handling. Production code has proper exception handling. | | 17 | Insecure Default Configuration | Low (9.8) | CWE-200 | [constants.py](src/config/constants.py) | 🔴 False Positive | Scanner contradicts itself - report says prod defaults are insecure but they're actually secure (`API_AUTH=true`, `HTTPS_ONLY=true` in prod). | | 18 | Improper Error Handling (test_send_mail.py) | Low (7.5) | CWE-209 | unit_test/test_send_mail.py | 🔴 False Positive | **Test file** - not production code. Production has proper error handling with sanitized messages. | --- ## Status Legend | Status | Meaning | |--------|---------| | ✅ Fixed | Vulnerability was real and has been fixed | | ⏭️ Skipped | Known issue, accepted risk or out of scope | | 🔴 False Positive | Scanner incorrectly flagged this as vulnerable | | ⏳ Pending | Under investigation or awaiting fix |