{"id":"CVE-2025-46721","url":"https://www.cyber-defence.io/tools/cve/CVE-2025-46721","generatedAt":"2026-10-28T01:19:09.618Z","title":"nosurf is cross-site request forgery (CSRF) protection middleware for Go.","description":"nosurf is cross-site request forgery (CSRF) protection middleware for Go. A vulnerability in versions prior to 1.2.0 allows an attacker who controls content on the target site, or on a subdomain of the target site (either via XSS, or otherwise) to bypass CSRF checks and issue requests on user's behalf. Due to misuse of the Go `net/http` library, nosurf categorizes all incoming requests as plain-text HTTP requests, in which case the `Referer` header is not checked to have the same origin as the target webpage. If the attacker has control over HTML contents on either the target website (e.g. `example.com`), or on a website hosted on a subdomain of the target (e.g. `attacker.example.com`), they will also be able to manipulate cookies set for the target website. By acquiring the secret CSRF token from the cookie, or overriding the cookie with a new token known to the attacker, `attacker.example.com` is able to craft cross-site requests to `example.com`. A patch for the issue was released in nosurf 1.2.0. In lieu of upgrading to a patched version of nosurf, users may additionally use another HTTP middleware to ensure that a non-safe HTTP request is coming from the same origin (e.g. by requiring a `Sec-Fetch-Site: same-origin` header in the request).","published":"2025-05-13T16:15:32.000Z","lastModified":"2026-06-17T09:26:52.000Z","status":"Analyzed","sourceIdentifier":"security-advisories@github.com","cvss":{"version":"4.0","score":6,"severity":"MEDIUM","vector":"CVSS: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:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/M"},"cwe":["CWE-352"],"affected":["nosurf project/nosurf"],"epss":{"score":0.00242,"percentile":0.15184,"date":"2026-10-26","history":[]},"kev":{"listed":false},"exploits":{"count":0,"verified":false,"firstPublished":null,"source":"Exploit-DB (https://gitlab.com/exploit-database/exploitdb)","entries":[]},"verdict":{"level":"low","text":"Lower severity and a low EPSS score (0.24%). Track it; it rarely justifies an emergency change on its own."},"changes":[],"references":[{"url":"https://github.com/advisories/GHSA-rq77-p4h8-4crw","tags":["Not Applicable"],"source":"security-advisories@github.com"},{"url":"https://github.com/justinas/nosurf-cve-2025-46721","tags":["Exploit","Third Party Advisory"],"source":"security-advisories@github.com"},{"url":"https://github.com/justinas/nosurf/commit/ec9bb776d8e5ba9e906b6eb70428f4e7b009feee","tags":["Patch"],"source":"security-advisories@github.com"},{"url":"https://github.com/justinas/nosurf/releases/tag/v1.2.0","tags":["Release Notes"],"source":"security-advisories@github.com"},{"url":"https://github.com/justinas/nosurf/security/advisories/GHSA-w9hf-35q4-vcjw","tags":["Vendor Advisory"],"source":"security-advisories@github.com"},{"url":"https://github.com/advisories/GHSA-rq77-p4h8-4crw","tags":["Not Applicable"],"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0"}],"sources":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2025-46721","epss":"https://www.first.org/epss/","kev":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","exploitdb":"https://www.exploit-db.com/"},"licence":"CC BY 4.0 — link back to the CVE Explorer if you publish the results; upstream data remains subject to its own terms."}