Add Strict-Transport-Security header to prevent HTTPS downgrade attacks (Issue #154) - #166
Open
anshul23102 wants to merge 1 commit into
Open
Add Strict-Transport-Security header to prevent HTTPS downgrade attacks (Issue #154)#166anshul23102 wants to merge 1 commit into
anshul23102 wants to merge 1 commit into
Conversation
Fixes NEXARA-oss#154 Implements HSTS header to prevent HTTP downgrade attacks and protect against network-level interception of API keys and observability data. Changes: - Added Strict-Transport-Security header (max-age: 1 year, preload enabled) - Added X-Content-Type-Options: nosniff to prevent MIME type sniffing - Added X-Frame-Options: DENY to prevent clickjacking - Added X-XSS-Protection: 1; mode=block for legacy browser protection Headers are set on all HTTP responses via Fastify onSend hook. Effectively prevents HTTPS downgrade attacks and forces HTTPS on all browsers that have previously visited the service. This addresses security concerns for deployments handling sensitive agent credentials and trace data.
Contributor
Author
|
Hi @NEXARA-oss team! 👋 I've completed the implementation for Issue #154 (Strict-Transport-Security header). What's Included✅ HSTS header with 1-year max-age and preload support Security Benefits
For ReviewLabels valuable for tracking:
Ready for your review! 🚀 Contributed as part of GSSoC 2026 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The PulseStack HTTP server was not setting Strict-Transport-Security (HSTS) headers. This allows network-level attackers to downgrade connections from HTTPS to HTTP, enabling interception of API keys and observability data.
Changes
Security Impact
✅ Prevents HTTPS downgrade attacks
✅ Protects API credentials and trace data from network interception
✅ Enables HSTS preload list inclusion for enhanced protection
✅ Defends against MIME type sniffing attacks
✅ Prevents framing/clickjacking attacks
Configuration
Fixes #154
Testing