Miggo Logo

CVE-2024-56159: Astro's server source code is exposed to the public if sourcemaps are enabled

N/A

CVSS Score

Basic Information

EPSS Score
0.8021%
Published
12/19/2024
Updated
12/19/2024
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
astronpm>= 5.0.0-alpha.0, <= 5.0.75.0.8
astronpm<= 4.16.174.16.18

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stemmed from two key issues:

  1. ssrMoveAssets (called at line 139 in the original code) explicitly moved server assets (including sourcemaps) to the client directory, which is publicly exposed.
  2. cleanServerOutput didn't delete server sourcemap files after static generation. The commit diff shows added logic to delete .map files in cleanServerOutput, confirming this was a missing cleanup step. Both functions operated on server-generated files in a publicly accessible location (dist/client), violating CWE-219 (sensitive data under web root). The GitHub patch directly modifies these functions to address the exposure.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry * *u* in t** *uil* pro**ss *llows *ny un*ut**nti**t** us*r to r*** p*rts o* t** s*rv*r sour** *o**. ### **t*ils *urin* *uil*, *lon* wit* *li*nt *ss*ts su** *s *ss *n* *ont *il*s, t** sour**m*p *il*s ***or t** s*rv*r *o**** *r* mov** to *

Reasoning

T** vuln*r**ility st*mm** *rom two k*y issu*s: *. ssrMov**ss*ts (**ll** *t lin* *** in t** ori*in*l *o**) *xpli*itly mov** s*rv*r *ss*ts (in*lu*in* sour**m*ps) to t** *li*nt *ir**tory, w*i** is pu*li*ly *xpos**. *. *l**nS*rv*rOutput *i*n't **l*t* s*r