CVE-2025-24358

Medium

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.

SeverityMedium
CVSS5.4
Exploit probability—
ProductGithub.com/gorilla/csrf
PublishedApr 15, 2025
First seenApr 15, 2025

How to fix

Update
  • github.com/gorilla/csrf1.7.3 or later

Affected products

ProductAffected versionsFixed in
github.com/gorilla/csrfGov < 1.7.31.7.3

Check your version

Choose the product and enter the version you run to see whether it falls in the affected range.

In the Intelligence 360 plan

Attack Surface Management

See the assets tied to your domains, the technologies they run and known vulnerabilities in one list.