一句话:提出 JS Recon,结合静态 AST 分析、动态沙箱执行与 RSC 协议操纵,自动恢复现代 JS 打包产物语义并审计安全暴露。
现代 Web 应用经编译打包后,状态被拆成执行片段,依赖由运行时引擎编排;打包器可能破坏服务端-客户端隔离,把敏感后端上下文和内部路由逻辑静默带入客户端产物,作者将这一问题形式化为“编译后语义坍缩”。传统扫描器把编译后 JavaScript 当作扁平静态资源,无法重建动态依赖图或解析专有流式协议。JS Recon 对现代 bundle 做类反编译分析:静态将混淆载荷提升为 AST 以定位路由逻辑,再在原生沙箱中动态求值局部字典,并操纵 React Server Component 流式协议迫使后端暴露路由状态。在 Tranco Top 1M 上,它提取 250 万余个孤立 sourcemap,受控环境提取率 97.04%(基线 0%),恢复 6,210 个已验证密钥,发现倍数达 6.6 倍,并识别出 379 个根域上的 447 个唯一密钥。
Modern web applications rely on advanced compilation pipelines to transform high-level source code into heavily optimized execution bundles. This structural transformation introduces a systemic security gap that we formalize as Post-Compilation Semantic Collapse. During the build process, the application state is fractured into disjointed execution fragments, and dependencies are subsequently orchestrated via dynamic runtime engines. While developers operate under the assumption of server-client isolation, modern bundlers can weaken this boundary to optimize performance, silently migrating sensitive backend context and internal routing logic into public client-side artifacts. Traditional security scanners are poorly matched to these architectural exposures. By evaluating compiled JavaScript as a flat, static resource, existing tools fail to reconstruct dynamic dependency graphs or interpret the proprietary streaming protocols required to map the modern attack surface. To overcome this structural gap, we introduce JS Recon, an automated semantic recovery framework that performs decompiler-like analysis for modern JavaScript bundles. Because bundlers obscure execution paths using cryptographic hashes and functionally transformed arrays, pure static parsing is insufficient. JS Recon defeats this obfuscation by coupling static structural analysis with targeted dynamic execution. Specifically, it statically lifts heavily minified payloads into an Abstract Syntax Tree (AST) to isolate obfuscated routing logic, and subsequently evaluates these localized runtime dictionaries within a dynamic native sandbox. Furthermore, to resolve decentralized server-side dependencies, the pipeline actively manipulates proprietary React Server Component (RSC) streaming protocols, forcing the backend to dynamically serialize and expose routing state not present in static artifacts. We deployed JS Recon against the Tranco Top 1M domains to execute a large-scale measurement study. Our pipeline extracted over 2.5 million orphaned sourcemaps, achieving a 97.04% extraction rate in controlled environments compared to 0% for baseline tools. Furthermore, JS Recon recovered 6,210 verified secret instances, establishing a 6.6x discovery multiplier over the leading reconnaissance spider. Our measurement identifies a widespread ecosystem issue, finding 447 globally unique verified secrets distributed across 379 root domains. This study shows that automated semantic recovery is needed to audit build artifacts and map the obscured attack surfaces of modern web deployments.