Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

GHSA-gv83-gqw6-9j2c: GoFiber never set HSTS header in helmet middleware due to incorrect protocol check

0
Medium
Published: 07/06/2026 (07/06/2026, 20:43:12 UTC)
Source: GCVE Database
Product: github.com/gofiber/fiber

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

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

Affected software

Goghsa
github.com/gofiber/fiber
Affected versions
<3.4.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/06/2026, 23:14:10 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses