Cross-site Request Forgery (CSRF) Affecting astro package, versions >=7.0.0 <7.0.6


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

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-JS-ASTRO-18085612
  • published21 Jul 2026
  • disclosed20 Jul 2026
  • creditJared Gore

Introduced: 20 Jul 2026

New CVE NOT AVAILABLE CWE-352  (opens in a new tab)

How to fix?

Upgrade astro to version 7.0.6 or higher.

Overview

astro is an Astro is a modern site builder with web best practices, performance, and DX front-of-mind.

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) via the security.checkOrigin logic when middleware() is absent or mounted after actions() or pages() in the composable pipeline. An attacker can perform unauthorized state-changing actions on behalf of a user by sending crafted cross-origin requests that bypass origin checks.

Note: This is only exploitable if the composable pipeline is used with either actions() mounted before middleware() or pages() used without middleware().

Workaround

This vulnerability can be mitigated by ensuring middleware() is mounted before both actions() and pages() in the composable pipeline, and that it is always included even when no custom middleware logic is needed.

CVSS Base Scores

version 4.0
version 3.1