fkie_cve-2025-46721
Vulnerability from fkie_nvd
Published
2025-05-13 16:15
Modified
2025-06-23 14:55
Severity ?
Summary
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).
References
Impacted products
Vendor | Product | Version | |
---|---|---|---|
nosurf_project | nosurf | * |
{ "configurations": [ { "nodes": [ { "cpeMatch": [ { "criteria": "cpe:2.3:a:nosurf_project:nosurf:*:*:*:*:*:go:*:*", "matchCriteriaId": "C2513CBF-78BE-420F-9448-6C4226E36EC9", "versionEndExcluding": "1.2.0", "vulnerable": true } ], "negate": false, "operator": "OR" } ] } ], "cveTags": [], "descriptions": [ { "lang": "en", "value": "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\u0027s 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)." }, { "lang": "es", "value": "nosurf es un middleware de protecci\u00f3n contra cross-site request forgery (CSRF) para Go. Una vulnerabilidad en versiones anteriores a la 1.2.0 permite a un atacante que controla el contenido del sitio web objetivo o de un subdominio del mismo (ya sea mediante XSS o de otro modo) eludir las comprobaciones CSRF y emitir solicitudes en nombre del usuario. Debido al uso indebido de la librer\u00eda `net/http` de Go, nosurf categoriza todas las solicitudes entrantes como solicitudes HTTP de texto plano, en cuyo caso no se comprueba que el encabezado `Referer` tenga el mismo origen que la p\u00e1gina web objetivo. Si el atacante controla el contenido HTML del sitio web objetivo (p. ej., `example.com`) o de un sitio web alojado en un subdominio del sitio objetivo (p. ej., `attacker.example.com`), tambi\u00e9n podr\u00e1 manipular las cookies configuradas para el sitio web objetivo. Al obtener el token CSRF secreto de la cookie o sobrescribirla con un nuevo token conocido por el atacante, `attacker.example.com` puede generar solicitudes entre sitios a `example.com`. Se public\u00f3 una correcci\u00f3n para este problema en nosurf 1.2.0. En lugar de actualizar a una versi\u00f3n parcheada de nosurf, los usuarios pueden usar otro middleware HTTP para garantizar que una solicitud HTTP no segura provenga del mismo origen (por ejemplo, al requerir un encabezado `Sec-Fetch-Site: same-origin` en la solicitud)." } ], "id": "CVE-2025-46721", "lastModified": "2025-06-23T14:55:07.967", "metrics": { "cvssMetricV31": [ { "cvssData": { "attackComplexity": "LOW", "attackVector": "NETWORK", "availabilityImpact": "NONE", "baseScore": 6.1, "baseSeverity": "MEDIUM", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "privilegesRequired": "NONE", "scope": "CHANGED", "userInteraction": "REQUIRED", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N", "version": "3.1" }, "exploitabilityScore": 2.8, "impactScore": 2.7, "source": "nvd@nist.gov", "type": "Primary" } ], "cvssMetricV40": [ { "cvssData": { "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "Safety": "NOT_DEFINED", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "attackVector": "NETWORK", "availabilityRequirement": "NOT_DEFINED", "baseScore": 6.0, "baseSeverity": "MEDIUM", "confidentialityRequirement": "NOT_DEFINED", "exploitMaturity": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "privilegesRequired": "NONE", "providerUrgency": "NOT_DEFINED", "subAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "userInteraction": "PASSIVE", "valueDensity": "NOT_DEFINED", "vectorString": "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/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "version": "4.0", "vulnAvailabilityImpact": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "HIGH", "vulnerabilityResponseEffort": "NOT_DEFINED" }, "source": "security-advisories@github.com", "type": "Secondary" } ] }, "published": "2025-05-13T16:15:31.750", "references": [ { "source": "security-advisories@github.com", "tags": [ "Not Applicable" ], "url": "https://github.com/advisories/GHSA-rq77-p4h8-4crw" }, { "source": "security-advisories@github.com", "tags": [ "Exploit", "Third Party Advisory" ], "url": "https://github.com/justinas/nosurf-cve-2025-46721" }, { "source": "security-advisories@github.com", "tags": [ "Patch" ], "url": "https://github.com/justinas/nosurf/commit/ec9bb776d8e5ba9e906b6eb70428f4e7b009feee" }, { "source": "security-advisories@github.com", "tags": [ "Release Notes" ], "url": "https://github.com/justinas/nosurf/releases/tag/v1.2.0" }, { "source": "security-advisories@github.com", "tags": [ "Vendor Advisory" ], "url": "https://github.com/justinas/nosurf/security/advisories/GHSA-w9hf-35q4-vcjw" }, { "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": [ "Not Applicable" ], "url": "https://github.com/advisories/GHSA-rq77-p4h8-4crw" } ], "sourceIdentifier": "security-advisories@github.com", "vulnStatus": "Analyzed", "weaknesses": [ { "description": [ { "lang": "en", "value": "CWE-352" } ], "source": "security-advisories@github.com", "type": "Secondary" } ] }
Loading…
Loading…
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.
Loading…
Loading…