Patchfirst
CVE-2024-56159 Public exploit High · 7.8 EPSS 1.5%

Server source code is exposed to the public if sourcemaps are enabled

Fix:upgrade astro to 5.15.8 or later also fixes CVE-2025-55303, CVE-2025-64764 Details ↓

withastro · astro

Summary

The Astro web framework (withastro/astro) has a build-process bug that moves server-side sourcemap files into the publicly accessible dist/client folder, affecting server-output projects on Astro 5.0.3 through 5.0.7 and static-output projects on older Astro 4 and 5 releases, when sourcemaps are enabled, including through integrations such as Sentry. An unauthenticated remote attacker can read the server source code by sending a plain HTTP GET request to predictably named .map files on the website, with no user interaction required.

Official description · CVE.org

Astro is a web framework for content-driven websites. A bug in the build process allows any unauthenticated user to read parts of the server source code. During build, along with client assets such as css and font files, the sourcemap files **for the server code** are moved to a publicly-accessible folder. Any outside party can read them with an unauthorized HTTP GET request to the same server hosting the rest of the website. While some server files are hashed, making their access obscure, the files corresponding to the file system router (those in `src/pages`) are predictably named. For example. the sourcemap file for `src/pages/index.astro` gets named `dist/client/pages/index.astro.mjs.map`. This vulnerability is the root cause of issue #12703, which links to a simple stackblitz project demonstrating the vulnerability. Upon build, notice the contents of the `dist/client` (referred to as `config.build.client` in astro code) folder. All astro servers make the folder in question accessible to the public internet without any authentication. It contains `.map` files corresponding to the code that runs on the server. All **server-output** projects on Astro 5 versions **v5.0.3** through **v5.0.7**, that have **sourcemaps enabled**, either directly or through an add-on such as `sentry`, are affected. The fix for **server-output** projects was released in **astro@5.0.8**. Additionally, all **static-output** projects built using Astro 4 versions **4.16.17 or older**, or Astro 5 versions **5.0.8 or older**, that have **sourcemaps enabled** are also affected. The fix for **static-output** projects was released in **astro@5.0.9**, and backported to Astro v4 in **astro@4.16.18**. The immediate impact is limited to source code. Any secrets or environment variables are not exposed unless they are present verbatim in the source code. There is no immediate loss of integrity within the the vulnerable server. However, it is possible to subsequently discover another vulnerability via the revealed source code . There is no immediate impact to availability of the vulnerable server. However, the presence of an unsafe regular expression, for example, can quickly be exploited to subsequently compromise the availability. The fix for **server-output** projects was released in **astro@5.0.8**, and the fix for **static-output** projects was released in **astro@5.0.9** and backported to Astro v4 in **astro@4.16.18**. Users are advised to update immediately if they are using sourcemaps or an integration that enables sourcemaps.

Breakdown
65.6 / 100
Exploited
Yes, in VulnCheck KEV
Reports
0
Tactics
0/15

First seen exploited 14 months after disclosure.

  1. Disclosedday 0
  2. First seen exploitedVulnCheck KEV evidence+14 mo

6 fixes in astro over 12 months. The latest fix listed for astro is 5.13.10.

Fixes in astronpm package, by fixed version. Earlier and later fixes in the same package, not necessarily the same bug.

  1. 4.16.1CVE-2024-4788514 Oct 2024
  2. 4.16.17CVE-2024-5614018 Dec 2024
  3. 5.0.8CVE-2024-5615919 Dec 2024
  4. 5.12.8CVE-2025-547938 Aug 2025
  5. 5.13.2CVE-2025-5530319 Aug 2025
  6. 5.13.10CVE-2025-5983728 Oct 2025Latest listed

Affected versions and fixes

as published in the CVE record

withastro astro

Affected: >= 5.0.0, < 5.0.8 · < 4.16.18

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: astro.

Upgrade to 5.15.8 or later

Fixes this CVE and 2 other known vulnerabilities in this package (CVE-2025-55303, CVE-2025-64764).

npmnpm install astro@5.15.8

First fixed in 5.0.8 for CVE-2024-56159.

Affected versions, by release line

If you runUpgrade to
5.0.0-alpha.0 up to 5.0.85.15.8first fix for this CVE: 5.0.8
All versions before 4.16.18

Still affected on this line by CVE-2025-64764 (fixed in 5.15.8, a newer line).

4.16.19first fix for this CVE: 4.16.18

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

References

4 links, grouped by NVD tag
↑ ↓ chooseEnter openEsc close