首页 > 解决方案 > 加强有关 LDAP 条目中毒的投诉

问题描述

在我的项目中,我使用下面的代码使用 LDAP 进行身份验证,在我的 WebSecurityContext

 authenticationMngrBuilder.ldapAuthentication().userDetailsContextMapper(getLdapUser())
            .contextSource(ldapContext())
            .userSearchFilter("(&(objectClass=user)))");

这里“authenticationMngrBuilder”的类型是 org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder

“LDAP 条目中毒 执行返回对象的 LDAP 搜索的应用程序将允许攻击者控制 LDAP 响应以在服务器上运行任意代码。”

Fortify 扫描抱怨这是易受攻击的,因为它将 LDAP 响应作为 Java 对象返回。

还有其他选择吗?

标签: javaspring-bootldap

解决方案


推荐阅读