Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malicious deserialization from LDAP entry #228

Closed
h3xstream opened this issue Oct 5, 2016 · 1 comment
Closed

Malicious deserialization from LDAP entry #228

h3xstream opened this issue Oct 5, 2016 · 1 comment
Labels
enhancement New feature or improvement to existing detector.
Milestone

Comments

@h3xstream
Copy link
Member

h3xstream commented Oct 5, 2016

When loading LDAP entry, enabling the automatic deserialisation is a risky behavior,

new SearchControls(originalControls.getSearchScope(),
                originalControls.getCountLimit(), originalControls.getTimeLimit(),
                originalControls.getReturningAttributes(), 
                true, //<--
                originalControls.getDerefLinkFlag());

If the LDAP address can be change or if some entries can be poison by an attacker, RCE could be trigger from the deserialization.

https://github.com/spring-projects/spring-security/blob/ce20cfcb9803a6175f6befc9008cadcc4e3b6d72/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java#L380

White paper from Black Hat USA 2016: https://www.blackhat.com/docs/us-16/materials/us-16-Munoz-A-Journey-From-JNDI-LDAP-Manipulation-To-RCE-wp.pdf (Page 29)


Also add the RCE risk to LDAP injection detector.

http://find-sec-bugs.github.io/bugs.htm#LDAP_INJECTION

@h3xstream h3xstream added the enhancement New feature or improvement to existing detector. label Oct 5, 2016
@h3xstream h3xstream added this to the version-1.6.0 milestone Oct 5, 2016
@h3xstream
Copy link
Member Author

Also look for searchControls.setReturningObjFlag(true)

h3xstream added a commit to h3xstream/find-sec-bugs that referenced this issue Feb 27, 2017
h3xstream added a commit to h3xstream/find-sec-bugs that referenced this issue Feb 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing detector.
Projects
None yet
Development

No branches or pull requests

1 participant