GHSA-gv83-gqw6-9j2c: GoFiber never set HSTS header in helmet middleware due to incorrect protocol check
The helmet middleware in gofiber/fiber versions prior to 3.4.0 does not set the Strict-Transport-Security (HSTS) header due to an incorrect protocol check. The code incorrectly compares the HTTP protocol version string instead of the URL scheme, causing the HSTS header to never be applied even when configured. This leaves HTTPS sites vulnerable to SSL stripping and protocol downgrade attacks.
AI Analysis
Technical Summary
In gofiber/fiber's helmet middleware, the condition to set the HSTS header checks c.Protocol() == "https". However, c.Protocol() returns the HTTP version string (e.g., "HTTP/1.1"), never "https". The correct method is c.Scheme(), which returns "https" for TLS connections. Because of this bug, the HSTS header block is never executed, disabling HSTS protection. The existing test incorrectly simulates this by forcing the protocol header to "https", which does not reflect real HTTP requests. This vulnerability affects all gofiber/fiber versions before 3.4.0 that use helmet middleware with HSTSMaxAge configured and serve HTTPS traffic.
Potential Impact
The absence of the HSTS header means browsers will not enforce HTTPS-only connections to the affected sites. This enables active network attackers to perform SSL stripping attacks, downgrade HTTPS connections to HTTP, and potentially intercept or manipulate traffic. Users may also have session cookies sent over unencrypted HTTP if the Secure flag is not set, increasing risk of cookie theft. The vulnerability requires an active man-in-the-middle attacker on the network path, which is plausible in public or corporate networks.
Mitigation Recommendations
A fix is available by changing the protocol check in middleware/helmet/helmet.go line 67 from c.Protocol() == "https" to c.Scheme() == "https". This correctly detects HTTPS connections and enables the HSTS header to be set when configured. Additionally, tests should be updated to simulate TLS connections realistically rather than forcing the protocol header. Users should upgrade to version 3.4.0 or later where this fix is applied or patch the code accordingly.
GHSA-gv83-gqw6-9j2c: GoFiber never set HSTS header in helmet middleware due to incorrect protocol check
Description
The helmet middleware in gofiber/fiber versions prior to 3.4.0 does not set the Strict-Transport-Security (HSTS) header due to an incorrect protocol check. The code incorrectly compares the HTTP protocol version string instead of the URL scheme, causing the HSTS header to never be applied even when configured. This leaves HTTPS sites vulnerable to SSL stripping and protocol downgrade attacks.
CVSS v3.1
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
In gofiber/fiber's helmet middleware, the condition to set the HSTS header checks c.Protocol() == "https". However, c.Protocol() returns the HTTP version string (e.g., "HTTP/1.1"), never "https". The correct method is c.Scheme(), which returns "https" for TLS connections. Because of this bug, the HSTS header block is never executed, disabling HSTS protection. The existing test incorrectly simulates this by forcing the protocol header to "https", which does not reflect real HTTP requests. This vulnerability affects all gofiber/fiber versions before 3.4.0 that use helmet middleware with HSTSMaxAge configured and serve HTTPS traffic.
Potential Impact
The absence of the HSTS header means browsers will not enforce HTTPS-only connections to the affected sites. This enables active network attackers to perform SSL stripping attacks, downgrade HTTPS connections to HTTP, and potentially intercept or manipulate traffic. Users may also have session cookies sent over unencrypted HTTP if the Secure flag is not set, increasing risk of cookie theft. The vulnerability requires an active man-in-the-middle attacker on the network path, which is plausible in public or corporate networks.
Mitigation Recommendations
A fix is available by changing the protocol check in middleware/helmet/helmet.go line 67 from c.Protocol() == "https" to c.Scheme() == "https". This correctly detects HTTPS connections and enables the HSTS header to be set when configured. Additionally, tests should be updated to simulate TLS connections realistically rather than forcing the protocol header. Users should upgrade to version 3.4.0 or later where this fix is applied or patch the code accordingly.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-gv83-gqw6-9j2c
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-53624"]
- Ecosystems
- ["Go"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 3.1
Threat ID: 6a4c340527e9c797195f64ad
Added to database: 07/06/2026, 23:02:29 UTC
Last enriched: 07/06/2026, 23:14:10 UTC
Last updated: 07/06/2026, 23:14:10 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.