Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文件上传未过滤 #15

Open
Redpeppersir opened this issue Oct 20, 2024 · 0 comments
Open

文件上传未过滤 #15

Redpeppersir opened this issue Oct 20, 2024 · 0 comments

Comments

@Redpeppersir
Copy link

**问题描述:**没有对文件类型进行验证,攻击者可以上传恶意文件 直接通过ToolUtil.getFileSuffix(picture.getOriginalFilename()) 保存原有后缀名 可上传恶意的html文件在访问时候触发xss
修复建议: 校验文件上传的后缀 renderPicture 位置返回base64编码格式 如: const base64Image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...";

url: /mgr/upload
参数:file: picture
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant