CVE-2024-56159

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.
CVSS

No CVSS.

Configurations

No configuration.

History

20 Dec 2024, 21:15

Type Values Removed Values Added
Summary
  • (es) Astro es un framework web para sitios web basados en contenido. Un error en el proceso de compilación permite que cualquier usuario no autenticado lea partes del código fuente del servidor. Durante la compilación, junto con los recursos del cliente, como los archivos CSS y de fuentes, los archivos sourcemap **para el código del servidor** se mueven a una carpeta de acceso público. Cualquier tercero puede leerlos con una solicitud HTTP GET no autorizada al mismo servidor que aloja el resto del sitio web. Si bien algunos archivos del servidor están codificados, lo que hace que su acceso sea oscuro, los archivos correspondientes al enrutador del sistema de archivos (aquellos en `src/pages`) tienen un nombre predecible. Por ejemplo, el archivo sourcemap para `src/pages/index.astro` se llama `dist/client/pages/index.astro.mjs.map`. Esta vulnerabilidad es la causa principal del problema n.° 12703, que se vincula a un proyecto simple de stackblitz que demuestra la vulnerabilidad. Durante la compilación, observe el contenido de la carpeta `dist/client` (conocida como `config.build.client` en el código astro). Todos los servidores astro hacen que la carpeta en cuestión sea accesible a la Internet pública sin ninguna autenticación. Contiene archivos `.map` correspondientes al código que se ejecuta en el servidor. Todos los proyectos de **server-output** en las versiones de Astro 5 **v5.0.3** a **v5.0.7**, que tengan **sourcemaps habilitado**, ya sea directamente o mediante un complemento como `sentry`, se ven afectados. La corrección para los proyectos de **server-output** se publicó en **astro@5.0.8**. Además, todos los proyectos de **static-output** manipulados con Astro 4 versiones **4.16.17 o anteriores**, o Astro 5 versiones **5.0.8 o anteriores**, que tengan **sourcemaps habilitado** también se ven afectados. La corrección para los proyectos de **static-output** se publicó en **astro@5.0.9** y se incorporó a Astro v4 en **astro@4.16.18**. El impacto inmediato se limita al código fuente. No se exponen los secretos ni las variables de entorno a menos que estén presentes textualmente en el código fuente. No hay una pérdida inmediata de integridad dentro del servidor vulnerable. Sin embargo, es posible descubrir posteriormente otra vulnerabilidad a través del código fuente revelado. No hay un impacto inmediato en la disponibilidad del servidor vulnerable. Sin embargo, la presencia de una expresión regular insegura, por ejemplo, puede explotarse rápidamente para comprometer posteriormente la disponibilidad. La corrección para los proyectos **server-output** se publicó en **astro@5.0.8**, y la corrección para los proyectos **static-output** se publicó en **astro@5.0.9** y se incorporó a Astro v4 en **astro@4.16.18**. Se recomienda a los usuarios que actualicen de inmediato si están usando mapas de origen o una integración que los habilite.
References () https://github.com/withastro/astro/security/advisories/GHSA-49w6-73cw-chjr - () https://github.com/withastro/astro/security/advisories/GHSA-49w6-73cw-chjr -

19 Dec 2024, 19:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-12-19 19:15

Updated : 2024-12-20 21:15


NVD link : CVE-2024-56159

Mitre link : CVE-2024-56159

CVE.ORG link : CVE-2024-56159


JSON object : View

Products Affected

No product.

CWE
CWE-219

Storage of File with Sensitive Data Under Web Root