IPBUF安全漏洞报告
English
CVE-2026-45028 CVSS 6.1 中危

CVE-2026-45028 Astro框架加密绕过致XSS漏洞

披露日期: 2026-05-13

漏洞信息

漏洞编号
CVE-2026-45028
漏洞类型
XSS (跨站脚本攻击)
CVSS评分
6.1 中危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
需要交互 (UI:R)
影响产品
Astro Web Framework

相关标签

XSSAstroCryptographyWeb SecurityServer Side Rendering

漏洞概述

Astro是一个Web框架。在6.1.10版本之前,Astro使用AES-GCM加密来保护服务器岛屿props和slots参数的机密性和完整性,但未将密文绑定到其预期的组件或参数类型。攻击者可以将一个组件的加密props值重放为另一个组件的slots值,反之亦然。由于slots包含原始未转义的HTML,而props可能包含用户控制的值,这可能导致应用程序中的XSS。该漏洞发生在应用程序使用服务器岛屿、两个不同的服务器岛屿组件为prop和slot共享相同的键名,并且攻击者完全控制重叠prop的值时。

技术细节

该漏洞的核心在于Astro服务端组件的加密机制缺乏上下文绑定。虽然使用了AES-GCM进行加密,但解密过程仅验证了数据的完整性和真实性,未验证加密数据原本属于哪个组件或参数类型。攻击者利用这一逻辑缺陷,通过“重放攻击”将一个组件中受控的prop(属性)加密数据,发送给另一个组件的slot(插槽)接口。由于slot在渲染时默认将内容作为原始HTML处理而不进行转义,而prop通常被视为文本或对象,当服务器解密并将数据误用在slot上下文中时,攻击者注入的恶意脚本就会被浏览器执行,从而实现跨站脚本攻击(XSS)。

攻击链分析

STEP 1
侦察
攻击者分析目标Astro应用,识别使用Server Islands功能的组件,并寻找两个不同组件间是否存在同名的prop和slot键名。
STEP 2
注入与捕获
攻击者在其中一个组件(组件A)的受控prop中注入恶意数据,诱导服务器加密该数据,并捕获返回的加密密文。
STEP 3
重放攻击
攻击者向另一个组件(组件B)发送请求,将步骤2中捕获的密文作为组件B的slot参数值进行发送。
STEP 4
解密与渲染
服务端解密接收到的数据,由于缺乏类型绑定,误将其当作slot内容处理。Slot直接渲染原始HTML,导致恶意脚本在用户浏览器中执行。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
// Conceptual Proof of Concept for CVE-2026-45028 // Attacker scenario: Replaying an encrypted 'prop' as a 'slot' to trigger XSS. // 1. Assume the attacker controls the 'data' prop in 'ComponentA'. // They inject a malicious payload: var maliciousPayload = "<img src=x onerror=alert('XSS')>"; // 2. The server encrypts this payload for 'ComponentA' props (p). // Attacker intercepts the response (e.g., via Burp Suite or browser DevTools). // Example captured encrypted value (Base64): var interceptedEncryptedValue = "AQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyA..."; // 3. Attacker sends a request to 'ComponentB', which has a slot (s) // with the same key name 'data'. // The attacker replays the intercepted value as the slot input. fetch('/api/component-b-render', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ // Replaying the prop ciphertext as a slot ciphertext s: interceptedEncryptedValue }) }).then(response => response.text()) .then(html => { // 4. If vulnerable, the server renders the HTML containing the unescaped script. console.log("Vulnerable if alert appears in rendered HTML:", html); });

影响范围

Astro < 6.1.10

防御指南

临时缓解措施
如果无法立即升级,应全面审查使用Server Islands的代码,移除不同组件间props和slots的键名冲突,确保加密数据无法在错误的上下文中被重用。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表