已关闭
【自提单】【MindFormers】代码内部存在pickle序列化反序列化的风险 #1943
zyw-hw创建于 2025年6月24日关闭于 2025年6月24日
2025年6月24日 创建了缺陷
2025年6月24日 将优先级设置为次要
2025年6月24日 添加了
ctl/rdselftest
标签
2025年6月24日 将关联仓库设置为MindSpore/mindformers
2025年6月24日 将关联项目设置为MindSpore Bug Tracking System
2025年6月24日 将计划截止日期设置为2030-12-31
2025年6月24日 将里程碑设置为B-SIG-MindFormers
2025年6月24日 关联了MindSpore/mindformers Pull Request !6594
zyw-hw
2025年6月24日 评论:
2025年6月24日 评论:
Appearance & Root Cause
问题:【安全】代码内部存在pickle序列化反序列化的风险
根因:
代码中存在pickle序列化反序列化的风险,如np.load(*, allow_pickle=True),以及torch.load未指定weights_only参数为True
Fix Solution
修改函数的默认入参,使其不存在pickle序列化和反序列化风险
Fix Description & Test Suggestion
https://gitee.com/mindspore/mindformers/pulls/6594
Self-test Report & DT Review
目前前后端耗时在12分钟以内。
是否需要补充 ST/UT:否
原因:已有用例,且单点功能的验证已在pr描述中体现
Introduction Analysis
引入类型:特性合入引入
引入PR:https://gitee.com/mindspore/mindformers/pulls/4465
PR合入时间:2024年10月18日
问题是否偶现:是


2025年6月24日 将任务状态从 TODO 修改为DONE
2025年7月15日 修改了标题
2025年9月22日 关联了pull request:telechat2 del experimental api
2025年9月22日 关联了看板:测试极大数量
2025年12月14日 关联了看板:MindSpore Bug Tracking System
1.Describe the current behavior / 问题描述 (Mandatory / 必填)
代码中存在pickle序列化反序列化的风险,如np.load(*, allow_pickle=True),以及torch.load未指定weights_only参数为True
2.Environment / 环境信息 (Mandatory / 必填)
Hardware Environment / 硬件环境(Mandatory / 必填):
Hardware (e.g.
Ascend910B1/Mac CPU)样例:
迭代版本新增问题样例:(根据实际修改和增删)
bugfix版本问题引入样例:(根据实际修改和增删)
不涉及
3.Related testcase / 关联用例 (Mandatory / 必填)
不涉及
4.Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
不涉及
5.Describe the expected behavior / 预期结果 (Mandatory / 必填)
不涉及
6.Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
不涉及报错日志
7.Special notes for this issue/备注 (Optional / 选填)
**【定位人】**吴某某(根据实际修改)