Skip to content

Commit af901c8

Browse files
committed
Escape the user before using it in any search filter
nginxinc/nginx-ldap-auth@c0a43f4
1 parent 26f790d commit af901c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

root/app/nginx-ldap-auth-daemon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Copyright (C) 2014-2015 Nginx, Inc.
66
# Copyright (C) 2018 LinuxServer.io
77

8-
import sys, os, signal, base64, ldap, argparse
8+
import sys, os, signal, base64, ldap, ldap.filter, argparse
99
if sys.version_info.major == 2:
1010
from Cookie import BaseCookie
1111
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
@@ -101,7 +101,7 @@ def do_GET(self):
101101
self.log_error(e)
102102
return True
103103

104-
ctx['user'] = user
104+
ctx['user'] = ldap.filter.escape_filter_chars(user)
105105
ctx['pass'] = passwd
106106

107107
# Continue request processing

0 commit comments

Comments
 (0)