单词说明
vulnerabilities 漏洞 issue 问题 CVE Common Vulnerabilities and Exposures
常见漏洞和暴露
概念说明
JNDI (Java Naming and Directory Interface) 是一组应用程序接口,它为开发人员查找和访问各种资源提供了统一的通用接口,可以用来定位用户、网络、机器、对象和服务等各种资源。比如可以利用JNDI在局域网上定位一台打印机,也可以用JNDI来定位数据库服务或一个远程Java对象。JNDI底层支持RMI远程对象,RMI注册的服务可以通过JNDI接口来访问和调用。
JNDI支持多种命名和目录提供程序(Naming and Directory Providers),前文提到过的RMI注册表服务提供程序(RMI Registry Service Provider)允许通过JNDI应用接口对RMI中注册的远程对象进行访问操作。将RMI服务绑定到JNDI的一个好处是更加透明、统一和松散耦合,RMI客户端直接通过URL来定位一个远程对象,而且该RMI服务可以和包含人员,组织和网络资源等信息的企业目录链接在一起。
JNDI的应用场景比如:动态加载数据库配置文件,从而保持数据库代码不变动等。
我们要使用JNDI,必须要有服务提供方,常用的就是JDBC驱动提供数据库连接服务,然后我们配置JNDI连接。
JDK也为我们提供了一些服务接口:
DNS(Domain Name Service)域名服务 RMI(Java Remote Method Invocation)JAVA远程远程方法调用注册 CORBA (Common Object Request Broker Architecture) 公共对象请求代理结构服务 LDAP (Lightweight Directory Access Protocol) 轻量级目录访问协议
影响范围
本地模拟测试
Bug说明
https://github.com/apache/logging-log4j2/pull/607/files/2731a64d1f3e70001f6be61ba5f9b6eb55f88822?diff=unified&w=1
修复
<properties>
<log4j2.version>2.15.0</log4j2.version>
</properties>https://spring.io/blog/2021/12/10/log4j2-vulnerability-and-spring-boot
参考链接
https://news.ycombinator.com/item?id=29504755 https://open.work.weixin.qq.com/wwopen/mpnews?mixuin=3_HVCQAABwBHKvwGAAAUAA&mfid=WW0310-6x9-BwAABwB7tPj8XTxKnQJm-1T5c&idx=0&sn=d38bbc1075de2cdc8c9f67fc6d09894a&version=3.1.18.6007&platform=win https://github.com/apache/logging-log4j2/pull/614 https://semgrep.dev/s/chegg:log4j2_tainted_argument https://github.com/mbechler/marshalsec/blob/master/src/main/java/marshalsec/jndi/LDAPRefServer.java https://www.cnblogs.com/wlzjdm/p/7856356.html https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Injection/ https://docs.oracle.com/javase/jndi/tutorial/getStarted/overview/index.html https://www.huaweicloud.com/notice/2021/20211210001621800.html https://www.horizon3.ai/cve-2021-44228/ https://support.huaweicloud.com/usermanual-waf/waf_01_0008.html https://rickgray.me/2016/08/19/jndi-injection-from-theory-to-apply-blackhat-review/ https://www.blackhat.com/docs/us-16/materials/us-16-Munoz-A-Journey-From-JNDI-LDAP-Manipulation-To-RCE.pdf https://www.blackhat.com/docs/us-16/materials/us-16-Munoz-A-Journey-From-JNDI-LDAP-Manipulation-To-RCE-wp.pdf http://zerothoughts.tumblr.com/post/137769010389/fun-with-jndi-remote-code-injection https://docs.oracle.com/javase/8/docs/technotes/guides/rmi/codebase.html https://www.iswin.org/2016/01/24/Spring-framework-deserialization-RCE-分析以及利用 https://www.baeldung.com/jndi