Malicious Code Injection in astro Package - Version 7.1.0

astro Updated 18 Jul 2026

Summary

16/07/2026
CRITICAL
No i
Critical
Not published

MAL-2026-10726: Malicious code in astro (npm). Affects astro versions 7.1.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The astro package is a popular tool in the npm ecosystem, primarily used for building fast websites. It allows developers to create static sites with a focus on performance and simplicity. However, the version 7.1.0 of this package has been found to contain malicious code that impersonates the legitimate astro project, posing significant security risks to users.

Vulnerability Detail

The vulnerability arises from the release of astro version 7.1.0, which does not match the legitimate withastro/astro project. Instead, it contains dependencies with typosquatted names that lead to malicious packages. These packages are imported unconditionally in core modules, meaning that any invocation of 'require('astro')' or use of the CLI will execute attacker-controlled code. This can lead to unauthorized access, data breaches, and further exploitation of the user's environment.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall astro

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using the astro package version 7.1.0. Instead, utilize the legitimate version 5.x until a secure patch is confirmed. You can also monitor your dependencies using tools like Vulert, which alerts you to vulnerabilities in real-time.

Conclusion

The discovery of malicious code in the astro package version 7.1.0 highlights the importance of vigilance when managing dependencies in software projects. Users are strongly advised to update to the legitimate version and utilize monitoring tools like Vulert to stay informed about potential vulnerabilities.

See every vulnerability recorded for astro →

Share this vulnerability

FAQ

Astro is a framework for building fast websites, allowing developers to create static sites efficiently.

The malicious code can execute unauthorized actions within your project, potentially leading to data breaches or system compromise.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Immediately uninstall the affected version and install the legitimate version 5.x of the astro package.

Regularly update your dependencies, use tools like Vulert for monitoring vulnerabilities, and be cautious of packages with unusual naming conventions.

Related vulnerabilities

Recent vulnerabilities recorded for astro.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall astro

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback