Skip to content

Fix auth bypass and SSRF vulnerabilities (v2.5.64)#36

Merged
ttlequals0 merged 3 commits intomainfrom
fix/security-auth-bypass-and-ssrf
Feb 21, 2026
Merged

Fix auth bypass and SSRF vulnerabilities (v2.5.64)#36
ttlequals0 merged 3 commits intomainfrom
fix/security-auth-bypass-and-ssrf

Conversation

@ttlequals0
Copy link
Owner

Summary

  • Fix authentication bypass: Replace trivially spoofable X-Internal-Request: scheduler header with HMAC-validated X-Internal-Secret using cryptographic shared secret (auto-generated at startup or set via INTERNAL_API_SECRET env var)
  • Fix SSRF in healthcheck/notification services: Add validate_safe_url() with DNS resolution and private IP blocklist (RFC 1918, link-local, loopback, cloud metadata 169.254.x.x, IPv6 private), plus create_safe_session() with redirect validation hook
  • Fix ntfy config field mismatch: Accept both server_url (canonical) and server (legacy) in notification provider config validation

Test plan

  • 231 tests pass (0 failures, 8 skipped -- unchanged from baseline)
  • 22 new security tests in tests/test_security_fixes.py covering auth bypass and SSRF scenarios
  • Docker build succeeds (linux/amd64)
  • Image pushed to Docker Hub as ttlequals0/pixelprobe:2.5.64 and latest
  • Verify on live server: curl -H "X-Internal-Request: scheduler" .../api/version returns 401
  • Verify on live server: curl -H "X-Internal-Secret: <wrong>" .../api/version returns 401

- Replace spoofable X-Internal-Request header with HMAC-validated
  X-Internal-Secret for scheduler-to-app authentication
- Add validate_safe_url() with DNS resolution and private IP blocklist
  (RFC 1918, link-local, loopback, cloud metadata, IPv6 private)
- Add create_safe_session() with redirect validation hook
- Apply SSRF protection to healthcheck, webhook, and ntfy services
- Fix ntfy config field name mismatch (server vs server_url)
- Add 22 security tests covering auth bypass and SSRF scenarios
The auto-generated secret was unique per worker, causing 401s when
the scheduler (in one worker) sent requests handled by a different
worker. Now uses Redis SETNX to generate once and share across all
workers and the celery container.
@ttlequals0 ttlequals0 merged commit 9d2c957 into main Feb 21, 2026
6 checks passed
@ttlequals0 ttlequals0 deleted the fix/security-auth-bypass-and-ssrf branch February 21, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant