CVE-2025-24358

gorilla/csrf CSRF vulnerability due to broken Referer validation

State
Published
Severity
5.4 Medium
Published
Apr 15, 2025
Updated
May 1, 2025
Reserved
Jan 20, 2025

Read the record on cve.org

Description

gorilla/csrf provides Cross Site Request Forgery (CSRF) prevention middleware for Go web applications & services. Prior to 1.7.2, gorilla/csrf does not validate the Origin header against an allowlist. Its executes its validation of the Referer header for cross-origin requests only when it believes the request is being served over TLS. It determines this by inspecting the r.URL.Scheme value. However, this value is never populated for "server" requests per the Go spec, and so this check does not run in practice. This vulnerability allows an attacker who has gained XSS on a subdomain or top level domain to perform authenticated form submissions against gorilla/csrf protected targets that share the same top level domain. This vulnerability is fixed in 1.7.2.

Scores

CVSSScoreVectorSource
4.05.4 MediumCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:PGitHub_M

Weaknesses

  • CWE-352 Cross-Site Request Forgery (CSRF)

Affected Products

ProductVersions
csrfgorilla
  • < 1.7.3Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.