Skip to content
Heist/ feed
Back to feed
High

golang-github-gorilla-csrf — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2025-47909

Hosts listed in TrustedOrigins implicitly allow requests from the corresponding HTTP origins, allowing network MitMs to perform CSRF attacks. After the CVE-2025-24358 fix, a network attacker that places a form at http://example.com can't get it to submit to https://example.com because the Origin header is checked with sameOrigin against a synthetic URL. However, if a host is added to TrustedOrigins, both its HTTP and HTTPS origins will be allowed, because the schema of the synthetic URL is ignored and only the host is checked. For example, if an application is hosted on https://example.com and adds example.net to TrustedOrigins, a network attacker can serve a form at http://example.net to perform the attack. Applications should migrate to net/http.CrossOriginProtection, introduced in Go 1.25. If that is not an option, a backport is available as a module at filippo.io/csrf, and a drop-in replacement for the github.com/gorilla/csrf API is available at filippo.io/csrf/gorilla.

Products
golang-github-gorilla-csrf
Affected versions
1.6.2-1, 1.6.2-2, 1.7.1-1, 1.7.2+ds1-1, 1.7.2+ds1-2, 1.7.2+ds1-3, 1.7.2-1
Fixed versions
Not specified
CVEs
CVE-2025-47909
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 01:30 UTC · Revision 1

Source evidence

UBUNTU-CVE-2025-47909

core-osv · Original source

Published 29 Aug 2025, 16:15 UTC

Hosts listed in TrustedOrigins implicitly allow requests from the corresponding HTTP origins, allowing network MitMs to perform CSRF attacks. After the CVE-2025-24358 fix, a network attacker that places a form at http://example.com can't get it to submit to https://example.com because the Origin header is checked with sameOrigin against a synthetic URL. However, if a host is added to TrustedOrigins, both its HTTP and HTTPS origins will be allowed, because the schema of the synthetic URL is ignored and only the host is checked. For example, if an application is hosted on https://example.com and adds example.net to TrustedOrigins, a network attacker can serve a form at http://example.net to perform the attack. Applications should migrate to net/http.CrossOriginProtection, introduced in Go 1.25. If that is not an option, a backport is available as a module at filippo.io/csrf, and a drop-in replacement for the github.com/gorilla/csrf API is available at filippo.io/csrf/gorilla.

osv:UBUNTU-CVE-2025-47909

golang-github-gorilla-csrf

Fixed versions: Not specified

golang-github-gorilla-csrf

Fixed versions: Not specified

golang-github-gorilla-csrf

Fixed versions: Not specified

golang-github-gorilla-csrf

Fixed versions: Not specified

golang-github-gorilla-csrf

Fixed versions: Not specified

golang-github-gorilla-csrf

Fixed versions: Not specified

Complete source record
{
  "id": "4d07ae3ada151931bb7bcc9d76c432a2bd33074172841790fb15d9e311cd00fe",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2025-47909",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2025-47909",
    "summary": "Hosts listed in TrustedOrigins implicitly allow requests from the corresponding HTTP origins, allowing network MitMs to perform CSRF attacks. After the CVE-2025-24358 fix, a network attacker that places a form at http://example.com can't get it to submit to https://example.com because the Origin header is checked with sameOrigin against a synthetic URL. However, if a host is added to TrustedOrigins, both its HTTP and HTTPS origins will be allowed, because the schema of the synthetic URL is ignored and only the host is checked. For example, if an application is hosted on https://example.com and adds example.net to TrustedOrigins, a network attacker can serve a form at http://example.net to perform the attack. Applications should migrate to net/http.CrossOriginProtection, introduced in Go 1.25. If that is not an option, a backport is available as a module at filippo.io/csrf, and a drop-in replacement for the github.com/gorilla/csrf API is available at filippo.io/csrf/gorilla.",
    "evidence": "osv:UBUNTU-CVE-2025-47909",
    "products": [
      {
        "name": {
          "value": "golang-github-gorilla-csrf",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.6.2-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.6.2-2",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-gorilla-csrf",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.6.2-2",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-gorilla-csrf",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.7.1-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.7.2-1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-gorilla-csrf",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.7.2+ds1-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.7.2+ds1-2",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-gorilla-csrf",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.7.2+ds1-2",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "1.7.2+ds1-3",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-gorilla-csrf",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.7.2+ds1-2",
            "evidence": "/affected/5/versions"
          }
        ]
      }
    ],
    "severity": "high",
    "structured": {
      "id": "UBUNTU-CVE-2025-47909",
      "aliases": [
        "UBUNTU-CVE-2025-47909"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-gorilla-csrf",
            "purl": "pkg:deb/ubuntu/golang-github-gorilla-csrf?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "1.6.2-1",
            "1.6.2-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47909.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-gorilla-csrf-dev",
                "binary_version": "1.6.2-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-gorilla-csrf",
            "purl": "pkg:deb/ubuntu/golang-github-gorilla-csrf?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "1.6.2-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47909.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-gorilla-csrf-dev",
                "binary_version": "1.6.2-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-gorilla-csrf",
            "purl": "pkg:deb/ubuntu/golang-github-gorilla-csrf?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "1.7.1-1",
            "1.7.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47909.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-gorilla-csrf-dev",
                "binary_version": "1.7.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-gorilla-csrf",
            "purl": "pkg:deb/ubuntu/golang-github-gorilla-csrf?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "1.7.2+ds1-1",
            "1.7.2+ds1-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47909.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-gorilla-csrf-dev",
                "binary_version": "1.7.2+ds1-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-gorilla-csrf",
            "purl": "pkg:deb/ubuntu/golang-github-gorilla-csrf?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "1.7.2+ds1-2",
            "1.7.2+ds1-3"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47909.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-gorilla-csrf-dev",
                "binary_version": "1.7.2+ds1-3"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-gorilla-csrf",
            "purl": "pkg:deb/ubuntu/golang-github-gorilla-csrf?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "1.7.2+ds1-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-47909.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-gorilla-csrf-dev",
                "binary_version": "1.7.2+ds1-2"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:56:59.444794872Z",
      "provider": "osv",
      "upstream": [
        "CVE-2025-47909"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2025-47909",
        "https://www.cve.org/CVERecord?id=CVE-2025-47909",
        "https://github.com/golang/vulndb/issues/3884",
        "https://github.com/advisories/GHSA-82ff-hg59-8x73",
        "https://pkg.go.dev/vuln/GO-2025-3884"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2025-47909",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 356603,
  "published_at": "2025-08-29T16:15:00+00:00"
}