已关闭
【自提单】【MindFormers】代码内部存在pickle序列化反序列化的风险 #1943
zyw-hw创建于  2025年6月24日关闭于  2025年6月24日
zyw-hw
zyw-hw成员
2025年6月24日 创建

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)

    样例:

后端类型 硬件具体类别
Ascend 910B1
CPU Win CPU
  • Software Environment / 软件环境 (Mandatory / 必填):
    迭代版本新增问题样例:(根据实际修改和增删)
Software Version(根据实际修改,必填)
MindSpore MindSpore 2.7.0
MindFormers dev
Python Python 3.11.4

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 / 选填)

**【定位人】**吴某某(根据实际修改)

likedislike
zyw-hwzyw-hw成员
2025年6月24日 创建了缺陷
zyw-hwzyw-hw成员
2025年6月24日 将优先级设置为次要
zyw-hwzyw-hw成员
2025年6月24日 添加了   ctl/rdselftest 标签
zyw-hwzyw-hw成员
2025年6月24日 将关联仓库设置为MindSpore/mindformers
zyw-hwzyw-hw成员
2025年6月24日 将关联项目设置为MindSpore Bug Tracking System
zyw-hwzyw-hw成员
2025年6月24日 将计划截止日期设置为2030-12-31
zyw-hwzyw-hw成员
2025年6月24日 将里程碑设置为B-SIG-MindFormers
zyw-hwzyw-hw成员
2025年6月24日 关联了MindSpore/mindformers Pull Request !6594
zyw-hw
zyw-hw成员
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日
问题是否偶现:是

likedislike
zyw-hwzyw-hw成员
2025年6月24日 将任务状态从 TODO 修改为DONE
zyw-hwzyw-hw成员
2025年7月15日 修改了标题
Iivss成员
2025年9月10日 移除了ctl/rdselftest(已删除)标签
ibforuibforu
2025年9月22日 关联了pull request:telechat2 del experimental api
ibforuibforu
2025年9月22日 关联了看板:测试极大数量
AAtomGit-Bot
2025年12月14日 关联了看板:MindSpore Bug Tracking System