Skip to content

[ISSUE] PDF 预览未能禁用内嵌 JavaScript 导致存储型 XSS 漏洞 #761

Description

@FrankMao

Issue Type / 问题类型

Security / 安全问题

kkFileView Version / kkFileView 版本

5.0.0

Deployment Mode / 部署方式

docker

Environment / 环境信息

OS: [e.g. Windows/Linux]
Browser: [e.g. Chrome 120]
kkFileView Version: [e.g. 5.0.0]
Deployment: [e.g. Docker / Jar / Source]

Steps to Reproduce / 复现步骤

1、构造一个包含 JavaScript 的 PDF 文件(例如使用 /Names 字典嵌入 app.alert('xsstest'))。
2、通过 kkFileView 上传或使用预览接口打开该 PDF。
3、观察页面,弹窗出现,表明脚本成功执行。

Expected Result / 期望结果

1、在后续版本的 application.properties 中增加直接控制 PDF 脚本执行的配置项;
2、升级 PDF.js 至最新版,并默认关闭 enableScripting;
3、在文档中说明如何安全配置以避免 XSS。

Actual Result / 实际结果

应能通过配置彻底禁用 PDF 中的 JavaScript 执行,保障预览安全。用户不应看到任何 PDF 内嵌脚本产生的弹窗或行为。

Logs & Screenshots / 日志与截图

可参照复现步骤获取日志与截图

Sample File / 样例文件(可选)

No response

Checklist / 提交前检查

  • I have searched existing issues and did not find a duplicate. / 我已搜索现有 issue,未发现重复问题
  • I can reproduce this issue on the stated version/environment. / 我可在上述版本与环境复现该问题
  • I have masked sensitive information in logs/screenshots. / 我已对日志与截图中的敏感信息做脱敏处理

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/needs-infoWaiting for reporter feedback or reproduction details

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions