執行一個 LDAP 指令,該指令包含了由用戶控制的數值字符串,且使用濾字符串以外的字符,這可能會使攻擊者改變指令的含義或執行非法 LDAP 命令。
LDAP manipulation 錯誤在以下情況中出現:
1. 數據從一個不可信賴的數據源進入程序。
2. 數據在一個動態 LDAP 指令的濾字符串之外使用。
例 1:以下代碼從一個 HTTP 請求里讀取用戶名和密碼,并且使用它去執行 LDAP 查詢。
env.put(Context.SECURITY_AUTHENTICATION, "none");
DirContext ctx = new InitialDirContext(env);
String empID = request.getParameter("empID");
try
{
BasicAttribute attr = new BasicAttribute("empID", empID);
NamingEnumeration employee =
ctx.search("ou=People,dc=example,dc=com",attr);
...
[1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A1 Unvalidated Input
[2] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A2 Broken Access Control
[3] Standards Mapping - OWASP Top 10 2007 - (OWASP 2007) A4 Insecure Direct Object Reference
[4] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A4 Insecure Direct Object References
[5] Standards Mapping - FIPS200 - (FISMA) AC
[6] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3510 CAT I
[7] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3510 CAT I
[8] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 639
[9] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 90
[10] Standards Mapping - SANS Top 25 2009 - (SANS 2009) Insecure Interaction - CWE ID 116
[11] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Insufficient Authorization
[12] Standards Mapping - SANS Top 25 2011 - (SANS Top 25 2011) Porous Defenses - CWE ID 863
[13] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.3.1.1
[14] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.1
[15] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.2
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.5.4
[17] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 6.5.8
[18] Standards Mapping - FIPS200 - (FISMA) SI