CVEfocus › CVE database › CVE-2025-24358

CVE-2025-24358gorilla/csrf CSRF vulnerability due to broken Referer validation

CVSS 5.4 MediumEPSS 0.4% (higher than 27% of CVEs)Published 2025-04-15Updated 2025-05-01Assigner: GitHub_M

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.

CWE-352

What to do

Fixed builds are available from Debian, Go: see the table below for the fixed version per release.

Debian, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

3Fixed
2Fix pending
3Under investigation
2Will not fix

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10golang-github-gorilla-csrfFix pendingUBUNTU-CVE-2025-24358
Ubuntu 26.04golang-github-gorilla-csrfUnder investigationUBUNTU-CVE-2025-24358
Ubuntu 25.10golang-github-gorilla-csrfWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2025-24358
Ubuntu 24.04golang-github-gorilla-csrfUnder investigationUBUNTU-CVE-2025-24358
Ubuntu 22.04golang-github-gorilla-csrfUnder investigationUBUNTU-CVE-2025-24358
Ubuntu 20.04golang-github-gorilla-csrfWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2025-24358
Debian 14golang-github-gorilla-csrfFixed1.7.2+ds1-2DEBIAN-CVE-2025-24358
Debian 13golang-github-gorilla-csrfFixed1.7.2+ds1-2DEBIAN-CVE-2025-24358
Debian 12golang-github-gorilla-csrfFix pendingDEBIAN-CVE-2025-24358
Go librarygithub.com/gorilla/csrfFixed1.7.3GHSA-rq77-p4h8-4crw

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.