Spring RCE0day高危漏洞【请教贴】

988 1
lbwang 2022-3-30 10:32:32 | 显示全部楼层 |阅读模式
有大神了解该漏洞,详细说明下原理吗,如果被利用大概会出现什么问题

在Spring框架的JDK9版本(及以上版本)中,远程攻击者可在满足特定条件的基础上,通过框架的参数绑定功能获取AccessLogValve对象并诸如恶意字段值,从而触发pipeline机制并 写入任意路径下的文件。

目前已知,触发该漏洞需要满足两个基本条件:

使用JDK9及以上版本的Spring MVC框架
Spring 框架以及衍生的框架spring-beans-*.jar 文件或者存在CachedIntrospectionResults.class

漏洞影响范围:
JDK9 <= Spring Cloud Function
执行“java-version”命令可查看JDK版本

临时缓解措施
在应用系统的项目包下新建以下全局类,并保证这个类被Spring 加载到(推荐在Controller 所在的包中添加).完成类添加后,需对项目进行重新编译打包和功能验证测试。并重新发布项目。
  1. import org.springframework.core.annotation.Order;
  2. import org.springframework.web.bind.WebDataBinder;
  3. import org.springframework.web.bind.annotation.ControllerAdvice;
  4. import org.springframework.web.bind.annotation.InitBinder;



  5. @ControllerAdvice
  6. @Order(10000)
  7. public class a{
  8. @InitBinder
  9. public void setAllowedFields(WebDataBinder dataBinder) {
  10. String[] abd = new String[]{"class.*", "Class.*", "*.class.*", "*.Class.*"};
  11. dataBinder.setDisallowedFields(abd);
  12. }
  13. }
复制代码

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

lbwang

初入联盟

关注
  • 主题
  • 粉丝
  • 关注
这家伙很懒,什么都没留下!

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2026 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行