FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.qhelp at main · github/codeql · GitHub
github
codeql
Repository navigation
Code
Issues
1k
(1k)
Pull requests
474
(474)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
java
/
ql
/
src
/
Security
/
CWE
/
CWE-522
/
InsecureLdapAuth.qhelp
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (45 loc) · 1.49 KB
Breadcrumbs
codeql
/
java
/
ql
/
src
/
Security
/
CWE
/
CWE-522
/
InsecureLdapAuth.qhelp
Copy path
File metadata and controls
51 lines (45 loc) · 1.49 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!
DOCTYPE
qhelp
PUBLIC "-//Semmle//qhelp//EN" "qhelp.dtd">
<
qhelp
>
<
overview
>
<
p
>
When using the Java LDAP API to perform LDAPv3-style extended operations
and controls, a context with connection properties including user
credentials is started. Transmission of LDAP credentials in cleartext
allows remote attackers to obtain sensitive information by sniffing the
network.
</
p
>
</
overview
>
<
recommendation
>
<
p
>
Use the <
code
>ldaps://</
code
> protocol to send credentials through SSL or
use SASL authentication.
</
p
>
</
recommendation
>
<
example
>
<
p
>
In the following (bad) example, a <
code
>ldap://</
code
> URL is used and
credentials will be sent in plaintext.
</
p
>
<
sample
src
=
"
LdapAuthUseLdap.java
"
/>
<
p
>
In the following (good) example, a <
code
>ldaps://</
code
> URL is used so
credentials will be encrypted with SSL.
</
p
>
<
sample
src
=
"
LdapAuthUseLdaps.java
"
/>
<
p
>
In the following (good) example, a <
code
>ldap://</
code
> URL is used, but
SASL authentication is enabled so that the credentials will be encrypted.
</
p
>
<
sample
src
=
"
LdapEnableSasl.java
"
/>
</
example
>
<
references
>
<
li
>
Oracle:
<
a
href
=
"
https://docs.oracle.com/javase/jndi/tutorial/ldap/misc/url.html
"
>LDAP and LDAPS URLs</
a
>
</
li
>
<
li
>
Oracle:
<
a
href
=
"
https://docs.oracle.com/javase/tutorial/jndi/ldap/simple.html
"
>Simple authentication</
a
>
</
li
>
</
references
>
</
qhelp
>
Back
|
FazBrowse Home
|
New Git URL