Cloudanix VulnDB

CVE-2025-24358

None

CVSS

—

EPSS

0.4%

Published

Apr 15, 2025

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A flaw in a common Go web security component can let attackers on related websites perform actions as logged-in users without their knowledge.

Chainable
Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Moderate
Impact
Data Tampering
Component
Library
Class
CSRF
Remediation
Upgrade
Effort
Low
Patch risk
Low

What it actually does

The gorilla/csrf middleware skips Origin header allowlist validation entirely and only attempts Referer header checks for cross-origin requests when r.URL.Scheme indicates TLS; because Go server requests never populate r.URL.Scheme, the Referer check never executes, permitting authenticated form submissions from any origin sharing the same top-level domain.

Why it matters to the business

Compromise of a single subdomain via XSS can be escalated to unauthorized state-changing actions against any application using the vulnerable library on the same parent domain, increasing the blast radius of web application compromises and potential data integrity loss.

How an attack unfolds

An attacker first obtains XSS on a subdomain or top-level domain that shares the parent domain with the target application; they then craft cross-origin form POST requests that are accepted because neither Origin nor Referer validation runs, resulting in authenticated actions being performed on behalf of the victim user.

How to fix it

Upgrade gorilla/csrf to version 1.7.2 or later (commit 9dd6af1f6d30fc79fb0d972394deebdabad6b5eb); enable explicit Origin header allow-listing in application configuration after upgrade.

How to confirm the fix worked

Inspect the gorilla/csrf import path and module version in go.mod or vendor directory; confirm the presence of Origin header validation logic and removal of the r.URL.Scheme dependency for Referer checks in the running binary or source.

Typical attack path

  1. Obtain XSS execution on a subdomain or parent domain sharing the target's TLD
  2. Craft and deliver cross-origin authenticated form submissions
  3. Bypass CSRF checks due to absent Origin validation and non-functional Referer logic
  4. Perform unauthorized state-changing operations

How to detect it

Review application access and error logs for cross-origin POST requests lacking expected Origin or Referer headers; correlate with known XSS indicators on subdomains sharing the parent domain.

What your security team should do

  • Immediately upgrade all instances of gorilla/csrf to 1.7.2 or the referenced commit
  • Audit all Go web applications for use of this library and verify Origin allow-list configuration
  • Add defense-in-depth by enforcing SameSite cookies and additional custom Origin checks where feasible

The record

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.

Affected packages

Ecosystem Package Introduced Fixed
Go github.com/gorilla/csrf 0 1.7.3
Chainguard harbor-2.10 0 2.10.3-r16
Chainguard harbor-2.10-exporter 0 2.10.3-r16
Chainguard harbor-2.10-jobservice 0 2.10.3-r16
Chainguard harbor-2.10-portal 0 2.10.3-r16
Chainguard harbor-2.10-portal-nginx-config 0 2.10.3-r16
Chainguard harbor-2.10-redis-compat 0 2.10.3-r16
Chainguard harbor-2.10-registryctl 0 2.10.3-r16
Chainguard harbor-2.11 0 2.11.2-r8
Chainguard harbor-2.11-exporter 0 2.11.2-r8
Chainguard harbor-2.11-jobservice 0 2.11.2-r8
Chainguard harbor-2.11-photon-registry 0 2.11.2-r8
Chainguard harbor-2.11-portal 0 2.11.2-r8
Chainguard harbor-2.11-portal-nginx-config 0 2.11.2-r8
Chainguard harbor-2.11-redis-compat 0 2.11.2-r8
Chainguard harbor-2.11-registryctl 0 2.11.2-r8
Chainguard harbor-2.12 0 2.12.2-r10
Chainguard harbor-2.12-exporter 0 2.12.2-r10
Chainguard harbor-2.12-jobservice 0 2.12.2-r10
Chainguard harbor-2.12-photon-registry 0 2.12.2-r10
Chainguard harbor-2.12-portal 0 2.12.2-r10
Chainguard harbor-2.12-portal-nginx-config 0 2.12.2-r10
Chainguard harbor-2.12-redis-compat 0 2.12.2-r10
Chainguard harbor-2.12-registryctl 0 2.12.2-r10
Chainguard harbor-2.14 0 2.14.0-r1
Chainguard harbor-2.14-exporter 0 2.14.0-r1
Chainguard harbor-2.14-jobservice 0 2.14.0-r1
Chainguard harbor-2.14-photon-registry 0 2.14.0-r1
Chainguard harbor-2.14-portal 0 2.14.0-r1
Chainguard harbor-2.14-portal-nginx-config 0 2.14.0-r1
Chainguard harbor-2.14-redis-compat 0 2.14.0-r1
Chainguard harbor-2.14-registryctl 0 2.14.0-r1
Chainguard harbor-fips-2.10 0 2.10.3-r16
Chainguard harbor-fips-2.10-db 0 2.10.3-r16
Chainguard harbor-fips-2.10-exporter 0 2.10.3-r16
Chainguard harbor-fips-2.10-jobservice 0 2.10.3-r16
Chainguard harbor-fips-2.10-portal 0 2.10.3-r16
Chainguard harbor-fips-2.10-redis-compat 0 2.10.3-r16
Chainguard harbor-fips-2.10-registryctl 0 2.10.3-r16
Chainguard harbor-fips-2.11 0 2.11.2-r12
Chainguard harbor-fips-2.11-db 0 2.11.2-r12
Chainguard harbor-fips-2.11-exporter 0 2.11.2-r12
Chainguard harbor-fips-2.11-jobservice 0 2.11.2-r12
Chainguard harbor-fips-2.11-photon-registry 0 2.11.2-r12
Chainguard harbor-fips-2.11-portal 0 2.11.2-r12
Chainguard harbor-fips-2.11-redis-compat 0 2.11.2-r12
Chainguard harbor-fips-2.11-registryctl 0 2.11.2-r12
Chainguard harbor-fips-2.12 0 2.12.2-r11
Chainguard harbor-fips-2.12-db 0 2.12.2-r11
Chainguard harbor-fips-2.12-exporter 0 2.12.2-r11
Chainguard harbor-fips-2.12-jobservice 0 2.12.2-r11
Chainguard harbor-fips-2.12-photon-registry 0 2.12.2-r11
Chainguard harbor-fips-2.12-portal 0 2.12.2-r11
Chainguard harbor-fips-2.12-redis-compat 0 2.12.2-r11
Chainguard harbor-fips-2.12-registryctl 0 2.12.2-r11
Chainguard harbor-fips-2.13 0 2.13.0-r1
Chainguard harbor-fips-2.13-db 0 2.13.0-r1
Chainguard harbor-fips-2.13-exporter 0 2.13.0-r1
Chainguard harbor-fips-2.13-jobservice 0 2.13.0-r1
Chainguard harbor-fips-2.13-photon-registry 0 2.13.0-r1
Chainguard harbor-fips-2.13-portal 0 2.13.0-r1
Chainguard harbor-fips-2.13-redis-compat 0 2.13.0-r1
Chainguard harbor-fips-2.13-registryctl 0 2.13.0-r1
Chainguard harbor-fips-2.14 0 2.14.0-r1
Chainguard harbor-fips-2.14-db 0 2.14.0-r1
Chainguard harbor-fips-2.14-exporter 0 2.14.0-r1
Chainguard harbor-fips-2.14-jobservice 0 2.14.0-r1
Chainguard harbor-fips-2.14-photon-registry 0 2.14.0-r1
Chainguard harbor-fips-2.14-portal 0 2.14.0-r1
Chainguard harbor-fips-2.14-redis-compat 0 2.14.0-r1
Chainguard harbor-fips-2.14-registryctl 0 2.14.0-r1
Chainguard tailscale 0 1.82.0-r42
Chainguard tailscale-compat 0 1.82.0-r42
Chainguard zitadel-3 0 3.4.5-r1
Chainguard zitadel-3-compat 0 3.4.4-r0
Chainguard zitadel-4 0 4.10.1-r0
Chainguard zitadel-4-compat 0 4.6.4-r0
Debian:11 golang-github-gorilla-csrf 0 No fix
Debian:12 golang-github-gorilla-csrf 0 No fix
Debian:13 golang-github-gorilla-csrf 0 No fix
Wolfi harbor-2.10 0 2.10.3-r16
Wolfi harbor-2.10-jobservice 0 2.10.3-r16
Wolfi harbor-2.10-portal 0 2.10.3-r16
Wolfi harbor-2.10-portal-nginx-config 0 2.10.3-r16
Wolfi harbor-2.10-registryctl 0 2.10.3-r16
Wolfi harbor-2.11 0 2.11.2-r8
Wolfi harbor-2.11-jobservice 0 2.11.2-r8
Wolfi harbor-2.11-portal 0 2.11.2-r8
Wolfi harbor-2.11-portal-nginx-config 0 2.11.2-r8
Wolfi harbor-2.11-registryctl 0 2.11.2-r8
Wolfi harbor-2.12 0 2.12.2-r10
Wolfi harbor-2.12-jobservice 0 2.12.2-r10
Wolfi harbor-2.12-portal 0 2.12.2-r10
Wolfi harbor-2.12-portal-nginx-config 0 2.12.2-r10
Wolfi harbor-2.12-registryctl 0 2.12.2-r10
Wolfi harbor-2.14 0 2.14.0-r1
Wolfi harbor-2.14-exporter 0 2.14.0-r1
Wolfi harbor-2.14-jobservice 0 2.14.0-r1
Wolfi harbor-2.14-photon-registry 0 2.14.0-r1
Wolfi harbor-2.14-portal 0 2.14.0-r1
Wolfi harbor-2.14-portal-nginx-config 0 2.14.0-r1
Wolfi harbor-2.14-redis-compat 0 2.14.0-r1
Wolfi harbor-2.14-registryctl 0 2.14.0-r1
Wolfi tailscale 0 1.82.0-r42
Wolfi tailscale-compat 0 1.82.0-r42
openSUSE:Tumbleweed govulncheck-vulndb 0 0.0.20250422T181640-1.1
openSUSE:Tumbleweed velociraptor 0 0.7.0.4.git185.a5708584-2.1

Related vulnerabilities