{"answers":{"affected":"4 open source packages ship an affected version, including astro. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-56159 exists.","fix":"Upgrade astro to a fixed version for your release line: 4.16.18 or 5.0.8.","what":"CVE-2024-56159 is a high-severity vulnerability in withastro astro, published on 19 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-56159 and fix it if it is affected.\n\nWhat it is: CVE-2024-56159 is a high-severity vulnerability in withastro astro, published on 19 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-56159 exists.\n\nAffected packages and fixed versions:\n- astro (npm): affected all versions; fixed in 4.16.18\n- astro (npm): affected all versions; fixed in 4.16.18\n- astro (npm): affected from 5.0.0-alpha.0; fixed in 5.0.8\n- astro (npm): affected from 5.0.0-alpha.0; fixed in 5.0.8\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-56159/ (Markdown: https://insights.sbomify.com/CVE-2024-56159/index.md)","id":"CVE-2024-56159","markdown":"https://insights.sbomify.com/CVE-2024-56159/index.md","name":"CVE-2024-56159","record":{"aliases":["GHSA-49w6-73cw-chjr"],"analysis":{"component_type":"web_application","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"yes","non_default_config":true,"product_category":"Astro web framework","requires_auth":"none","summary":"Unauthenticated attackers can read server source code via exposed sourcemaps if enabled, potentially revealing secrets and aiding further attacks.","user_interaction":"not_required","vuln_class":"information_disclosure"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"astro","vendor":"astro"}],"cvss":{"score":7.8,"severity":"high","source":"cna","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:H/SI:L/SA:L","version":"4.0"},"cwes":[{"id":"CWE-219","name":"Storage of File with Sensitive Data Under Web Root"}],"description":"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":1,"refs":[{"date":null,"kind":"nuclei","ref":"http/cves/2024/CVE-2024-56159.yaml","stars":null,"title":"Astro - Information Disclosure"}],"tier":"weaponised"},"has_fix":true,"headline":"Server source code is exposed to the public if sourcemaps are enabled","id":"CVE-2024-56159","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"information_disclosure","year":"2024"},"n_packages":4,"n_references":4,"next":{"headline":"Security feature bypass in AMD EPYC™ 7001 Series","id":"CVE-2024-56161"},"packages":[{"ecosystem":"npm","fixed":["4.16.18"],"introduced":["0"],"last_affected":[],"package":"astro","purl":null,"source":"GHSA-49w6-73cw-chjr"},{"ecosystem":"npm","fixed":["4.16.18"],"introduced":["0"],"last_affected":[],"package":"astro","purl":"pkg:npm/astro","source":"GHSA-49w6-73cw-chjr"},{"ecosystem":"npm","fixed":["5.0.8"],"introduced":["5.0.0-alpha.0"],"last_affected":[],"package":"astro","purl":null,"source":"GHSA-49w6-73cw-chjr"},{"ecosystem":"npm","fixed":["5.0.8"],"introduced":["5.0.0-alpha.0"],"last_affected":[],"package":"astro","purl":"pkg:npm/astro","source":"GHSA-49w6-73cw-chjr"}],"prev":{"headline":"XWiki allows SQL injection in query endpoint of REST API with Oracle","id":"CVE-2024-56158"},"products":["astro"],"published":"2024-12-19","related":[{"cvss_score":7.5,"headline":"Astro: Host header SSRF in prerendered error page fetch","id":"CVE-2026-54299","kev_date_added":null,"published":"2026-06-22"},{"cvss_score":7.2,"headline":"astro allows bypass of image proxy domain validation leading to SSRF and potential XSS","id":"CVE-2025-59837","kev_date_added":null,"published":"2025-10-28"},{"cvss_score":7.1,"headline":"Astro: Reflected XSS via unescaped slot name","id":"CVE-2026-50146","kev_date_added":null,"published":"2026-06-22"},{"cvss_score":7.1,"headline":"Astro is vulnerable to Reflected XSS via the server islands feature","id":"CVE-2025-64764","kev_date_added":null,"published":"2025-11-19"},{"cvss_score":6.9,"headline":"Astro middleware authentication checks based on url.pathname can be bypassed via url encoded values","id":"CVE-2025-64765","kev_date_added":null,"published":"2025-11-19"},{"cvss_score":6.9,"headline":"Unauthorized third-party images in Astro’s _image endpoint","id":"CVE-2025-55303","kev_date_added":null,"published":"2025-08-19"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"attribution","licence":"MIT","name":"Nuclei templates"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-12-20","vendors":["withastro"]},"summary":"Unauthenticated attackers can read server source code via exposed sourcemaps if enabled, potentially revealing secrets and aiding further attacks.","url":"https://insights.sbomify.com/CVE-2024-56159/"}