Skip to content

Add security documentation for Host header validation#398

Merged
nijel merged 8 commits intomasterfrom
copilot/add-security-section-documentation
Feb 17, 2026
Merged

Add security documentation for Host header validation#398
nijel merged 8 commits intomasterfrom
copilot/add-security-section-documentation

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

The library constructs absolute URLs using the HTTP Host header for OAuth callbacks and redirects. Without proper deployment configuration, this enables host header injection attacks.

Changes

  • Created docs/security.rst: New top-level section documenting Host header handling and mitigation strategies
  • Updated docs/index.rst: Integrated security section in TOC between Installation and Configuration

Content Structure

Reverse proxy configuration

  • Host header validation requirements
  • Forwarded header trust boundaries (X-Forwarded-Host, Forwarded)
  • Framework-agnostic guidance without vendor-specific configs

Django configuration

  • ALLOWED_HOSTS explicit configuration requirements
  • Production wildcard prohibition
  • USE_X_FORWARDED_HOST trust model and proxy assumptions

Rendered Output

Security documentation page

The documentation clarifies this is deployment-level mitigation, not a library defect, and maintains the existing tone and formatting conventions.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.python.org
    • Triggering command: /usr/bin/python python -m sphinx -b html . _build/html (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: nijel <212189+nijel@users.noreply.github.com>
Copilot AI changed the title [WIP] Add security considerations section to documentation Add security documentation for Host header validation Feb 17, 2026
Copilot AI requested a review from nijel February 17, 2026 08:33
@nijel nijel marked this pull request as ready for review February 17, 2026 09:02
@nijel nijel enabled auto-merge (squash) February 17, 2026 09:03
@nijel nijel merged commit e265f42 into master Feb 17, 2026
6 checks passed
@nijel nijel deleted the copilot/add-security-section-documentation branch February 17, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants