python marshal loads failed_python – Marshal反序列化 – 不安全

我在一个项目中工作,我使用cPickle快速加载文件.几天前我读到,元帅甚至可能比cPickle更快.它对我有用,但我很好奇,the documentation的这个警告是关于:

Warning

The marshal module is not intended to be secure against erroneous or maliciously constructed data. Never unmarshal data received from an untrusted or unauthenticated source.

如果我不小心,会发生什么?

解决方法:

元帅

没有已知的方法来利用元帅.实际上执行代码时

使用marshal.loads()不是我能做的事情,而是看着

marhal.c源代码,我没有看到一个明显的方法.

BTW the warning for marshal is legit — the C code that unpacks marshal data

has not been carefully analyzed against buffer overflows and so on. Remember

the first time someone broke into a system through a malicious JPEG? The same

could happen with marshal. Seriously.

我建议你阅读剩下的讨论内容;一个错误显示在哪里

解组数据会导致Python出现段错误;自Python以来,这已得到修复

2.5(这个bug可能会被滥用来执行代码).其他错误可能

但仍然存在!

此外,元帅们提到:

This is not a general “per

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值