## 关键漏洞信息 ### 1. 风险描述 fastjson已使用黑白名单用于防御反序列化漏洞,经研究该利用在特定条件下可绕过默认autoType关闭限制,攻击远程服务器,风险影响较大。建议fastjson用户尽快采取安全措施保障系统安全。 ### 2. 影响版本 特定依赖存在下影响 ≤1.2.80 ### 3. 升级方案 #### 3.1 升级到最新版本1.2.83 - 版本涉及autotype行为变更,某些场景会出现不兼容的情况。 - 如遇问题可到 [Issues](https://github.com/alibaba/fastjson/issues) 寻求帮助。 - 或加入钉钉群 44597749 需求帮助。 #### 3.2 safeMode加固 - fastjson在1.2.68及之后的版本中引入了safeMode,配置safeMode后,无论白名单和黑名单,都不支持autoType,可杜绝反序列化Gadgets类变种攻击。 ##### 3.2.1 开启方法 - 参考 [fastjson_safemode](https://github.com/alibaba/fastjson/wiki/fastjson_safemode) ##### 3.2.2 使用1.2.83之后的版本是否需要使用safeMode - 1.2.83修复了此次发现的漏洞,开启safeMode是完全关闭autoType功能,避免类似问题再次发生。 - 这可能会有兼容问题,请充分评估对业务影响后开启。 ##### 3.2.3 开启了safeMode是否需要升级 - 开启safeMode不受本次漏洞影响,可以不做升级。 #### 3.3 升级到fastjson v2 - fastjson v2地址: [fastjson2/releases](https://github.com/alibaba/fastjson2/releases) - fastjson已经开源2.0版本,在2.0版本中,不再为了兼容提供白名单,提升了安全性。 - fastjson v2代码已经重写,性能有了很大提升,不完全兼容1.x,升级需要做认真的兼容测试。 - 升级遇到问题,可以在 [Issues](https://github.com/alibaba/fastjson2/issues) 寻求帮助。 #### 3.4 noneautotype版本 - 在5月26日后,为了方便使用老版本用户兼容安全加固需求,提供了noneautotype版本,效果和1.2.68的safeMode效果一样,完全禁止autotype功能。 - 使用noneautotype版本的用户也不受此次漏洞影响。 - [1.2.8_noneautotype](https://repo1.maven.org/maven2/com/alibaba/fastjson/1.2.8_noneautotype/) - [1.2.48_noneautotype](https://repo1.maven.org/maven2/com/alibaba/fastjson/1.2.48_noneautotype/) - [1.2.50_noneautotype](https://repo1.maven.org/maven2/com/alibaba/fastjson/1.2.50_noneautotype/) - [1.2.54_noneautotype](https://repo1.maven.org/maven2/com/alibaba/fastjson/1.2.54_noneautotype/) - [1.2.60_noneautotype](https://repo1.maven.org/maven2/com/alibaba/fastjson/1.2.60_noneautotype/) - [1.2.71_noneautotype](https://repo1.maven.org/maven2/com/alibaba/fastjson/1.2.71_noneautotype/) 如果需要更多autotype版本,请在 [Issues](https://github.com/alibaba/fastjson/issues) 提要求