安全加固: 为 UEditor 上传增加 MIME 校验、内容扫描和 .htaccess 防护#60
Closed
nilm61 wants to merge 1 commit into
Closed
Conversation
Uploader.class.php: - 新增 checkMimeType() 使用 exif_imagetype() 和 finfo_file() 验证文件真实 MIME 类型 - 新增 checkFileContent() 扫描上传文件中的 PHP 标签和 webshell 模式 - 新增 createHtaccess() 生成 .htaccess 禁止上传目录执行 PHP - 对 upFile()、upBase64()、saveRemote() 三个入口均应用安全检查 action_upload.php: - 上传后二次验证扩展名白名单 - 验证保存路径必须在允许的 upload 目录下 - 发现恶意文件立即删除 修复 CWE-434(任意文件上传)和 CWE-22(路径遍历)漏洞 基于 PbootCMS 3.2.15 安全性评估报告
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.
说明: