6.1
MEDIUM CVSS 3.1
CVE-2025-46721
nosurf vulnerable to CSRF due to non-functional same-origin request checks
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).

INFO

Published Date :

May 13, 2025, 4:15 p.m.

Last Modified :

June 23, 2025, 2:55 p.m.

Remotely Exploit :

Yes !
Affected Products

The following products are affected by CVE-2025-46721 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Nosurf_project nosurf
CVSS Scores
The Common Vulnerability Scoring System is a standardized framework for assessing the severity of vulnerabilities in software and systems. We collect and displays CVSS scores from various sources for each CVE.
Score Version Severity Vector Exploitability Score Impact Score Source
CVSS 3.1 MEDIUM [email protected]
CVSS 4.0 MEDIUM [email protected]
Solution
Upgrade nosurf to version 1.2.0 or later.
  • Upgrade nosurf to version 1.2.0.
  • Add middleware to check request origin.
  • Ensure 'Sec-Fetch-Site: same-origin' header.
  • Validate cookie handling in HTTP requests.
Public PoC/Exploit Available at Github

CVE-2025-46721 has a 3 public PoC/Exploit available at Github. Go to the Public Exploits tab to see the list.

References to Advisories, Solutions, and Tools

Here, you will find a curated list of external links that provide in-depth information, practical solutions, and valuable tools related to CVE-2025-46721.

URL Resource
https://github.com/advisories/GHSA-rq77-p4h8-4crw Not Applicable
https://github.com/justinas/nosurf-cve-2025-46721 Exploit Third Party Advisory
https://github.com/justinas/nosurf/commit/ec9bb776d8e5ba9e906b6eb70428f4e7b009feee Patch
https://github.com/justinas/nosurf/releases/tag/v1.2.0 Release Notes
https://github.com/justinas/nosurf/security/advisories/GHSA-w9hf-35q4-vcjw Vendor Advisory
https://github.com/advisories/GHSA-rq77-p4h8-4crw Not Applicable
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2025-46721 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2025-46721 weaknesses.

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

None

Go Nix

Updated: 4 months ago
0 stars 0 fork 0 watcher
Born at : April 30, 2025, 1:53 p.m. This repo has been linked 1 different CVEs too.

None

HTML Python Shell

Updated: 2 months, 1 week ago
0 stars 0 fork 0 watcher
Born at : Feb. 13, 2025, 8:50 a.m. This repo has been linked 891 different CVEs too.

📡 PoC auto collect from GitHub. ⚠️ Be careful Malware.

security cve exploit poc vulnerability

Updated: 8 hours, 25 minutes ago
7263 stars 1201 fork 1201 watcher
Born at : Dec. 8, 2019, 1:03 p.m. This repo has been linked 805 different CVEs too.

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2025-46721 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2025-46721 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • Initial Analysis by [email protected]

    Jun. 23, 2025

    Action Type Old Value New Value
    Added CVSS V3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
    Added CPE Configuration OR *cpe:2.3:a:nosurf_project:nosurf:*:*:*:*:*:go:*:* versions up to (excluding) 1.2.0
    Added Reference Type CISA-ADP: https://github.com/advisories/GHSA-rq77-p4h8-4crw Types: Not Applicable
    Added Reference Type GitHub, Inc.: https://github.com/advisories/GHSA-rq77-p4h8-4crw Types: Not Applicable
    Added Reference Type GitHub, Inc.: https://github.com/justinas/nosurf/commit/ec9bb776d8e5ba9e906b6eb70428f4e7b009feee Types: Patch
    Added Reference Type GitHub, Inc.: https://github.com/justinas/nosurf/releases/tag/v1.2.0 Types: Release Notes
    Added Reference Type GitHub, Inc.: https://github.com/justinas/nosurf/security/advisories/GHSA-w9hf-35q4-vcjw Types: Vendor Advisory
    Added Reference Type GitHub, Inc.: https://github.com/justinas/nosurf-cve-2025-46721 Types: Exploit, Third Party Advisory
  • CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0

    May. 13, 2025

    Action Type Old Value New Value
    Added Reference https://github.com/advisories/GHSA-rq77-p4h8-4crw
  • New CVE Received by [email protected]

    May. 13, 2025

    Action Type Old Value New Value
    Added 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).
    Added CVSS V4.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/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
    Added CWE CWE-352
    Added Reference https://github.com/advisories/GHSA-rq77-p4h8-4crw
    Added Reference https://github.com/justinas/nosurf/commit/ec9bb776d8e5ba9e906b6eb70428f4e7b009feee
    Added Reference https://github.com/justinas/nosurf/releases/tag/v1.2.0
    Added Reference https://github.com/justinas/nosurf/security/advisories/GHSA-w9hf-35q4-vcjw
    Added Reference https://github.com/justinas/nosurf-cve-2025-46721
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
Vulnerability Scoring Details
Base CVSS Score: 6
Attack Vector
Attack Complexity
Attack Requirements
Privileges Required
User Interaction
VS Confidentiality
VS Integrity
VS Availability
SS Confidentiality
SS Integrity
SS Availability
Base CVSS Score: 6.1
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality Impact
Integrity Impact
Availability Impact