Cross-site Request Forgery (CSRF) Affecting github.com/justinas/nosurf package, versions <1.2.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.03% (6th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Request Forgery (CSRF) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMJUSTINASNOSURF-10158733
  • published15 May 2025
  • disclosed13 May 2025
  • creditPatrick O'Doherty

Introduced: 13 May 2025

NewCVE-2025-46721  (opens in a new tab)
CWE-352  (opens in a new tab)

How to fix?

Upgrade github.com/justinas/nosurf to version 1.2.0 or higher.

Overview

github.com/justinas/nosurf is a HTTP package for Go that helps you prevent Cross-Site Request Forgery attacks.

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) due to the misuse of the net/http library. An attacker can bypass CSRF checks and issue requests on behalf of the user by controlling content on the target site or a subdomain and manipulating cookies to acquire or override the CSRF token.

Note: This fix is considered a breaking change; it is recommended to review the release notes for this version for additional information on avoiding post-update issues.

CVSS Base Scores

version 4.0
version 3.1