1、漏洞复现,生成含javascript的pdf文件
访问https://github.com/LOURC0D3/CVE-2024-4367-PoC

image.png
下载项目到本地

image.png
命令行进入项目目录,

image.png
执行代码
python CVE-2024-4367.py "alert('document.domain: '+window.document.domain+'\\nlocation: '+window.location+'\\ncookie: '+window.document.cookie);"
执行代码后,会在目录中生成pdf文件

image.png
用pdf.js预览该pdf会出现如下效果:

image.png
2、修复方法
方法1:pdf.js 升级到4.2.67以上版本
方法2:将 isEvalSupported 设为false,默认为true, 以3.##版本的pdf.js为例

image.png