fix(evaluation): 修复评估数据集上传的存储型 XSS - #2297
Open
CF-art wants to merge 1 commit into
Open
Conversation
评估上传接口直接信任客户端传入的 Content-Type 并存入 MinIO, 攻击者可在合法 CSV 中伪造 Content-Type: text/html, 导致 presigned 下载 URL 被浏览器当作 HTML 渲染执行, 形成存储型 XSS(7 天匿名可访问)。 该接口已通过 pd.read_csv + 列名校验确保文件为 CSV, 强制硬编码 content_type="text/csv"。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
评估上传接口直接信任客户端传入的 Content-Type 并存入 MinIO,
攻击者可在合法 CSV 中伪造 Content-Type: text/html,
导致 presigned 下载 URL 被浏览器当作 HTML 渲染执行,
形成存储型 XSS(7 天匿名可访问)。
该接口已通过 pd.read_csv + 列名校验确保文件为 CSV,
强制硬编码 content_type="text/csv"。
比如可能通过类似如下链接控制弹窗或者其他行为: https://bisheng.dataelem.com/bisheng/evaluation/dataset/db8ff191e73b41348092bb0154c04ffa.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20260813%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260813T102817Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=xxx