[
https://issues.apache.org/jira/browse/DERBY-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17637772#comment-17637772
]
Bryan Pendleton commented on DERBY-7147:
----------------------------------------
Rick, my fairly casual read of [RFC
2254|https://www.rfc-editor.org/rfc/rfc2254] says that we're only supposed to
escape the *value* data in the search filter, not the entire search filter.
That is, in the following, I think we should only be escaping 'uid', not all of
'searchFilter'.
{code:java}
@@ -418,6 +465,10 @@ String searchFilter =
this.leftSearchFilter + uid + this.rightSearchFilter;
+
+ // Escape the search filter as a defense against LDAP injection. See
DERBY-7147.
+ searchFilter = doFilterEscaping(searchFilter);
+{code}
> LDAP injection vulnerability in LDAPAuthenticationImpl
> ------------------------------------------------------
>
> Key: DERBY-7147
> URL: https://issues.apache.org/jira/browse/DERBY-7147
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.16.1.1
> Reporter: Richard N. Hillegas
> Assignee: Richard N. Hillegas
> Priority: Major
> Attachments: derby-7147-01-aa-reformatForReadability.diff,
> derby-7147-02-aa-escapeLDAPsearchFilter.diff
>
>
> An LDAP injection vulnerability has been identified in
> LDAPAuthenticationSchemeImpl.getDNFromUID(). An exploit has not been
> provided, but there is a possibility that an intruder could bypass
> authentication checks in Derby-powered applications which rely on external
> LDAP servers.
> For more information on LDAP injection, see
> https://www.synopsys.com/glossary/what-is-ldap-injection.html
--
This message was sent by Atlassian Jira
(v8.20.10#820010)