🇰🇷 한글 설명
python-ldap 3.4.5 미만 버전에서 escape_mode=1 설정 시, assertion_value 파라미터에 조작된 리스트나 딕셔너리를 전달하면 특수 문자 이스케이프가 누락되는 취약점이 존재합니다. 이를 통해 공격자는 LDAP 인젝션 공격을 수행하여 권한이 없는 LDAP 데이터에 접근하거나 이를 조작할 수 있습니다.
💡 쉬운 설명
프로그램이 사용자 입력을 안전하게 처리하지 못해, 공격자가 특수한 데이터를 보내면 보안 필터를 우회할 수 있는 문제입니다. 이를 통해 공격자는 데이터베이스의 정보를 몰래 훔쳐보거나 내용을 바꿀 수 있습니다.
🇺🇸 원문 (English)
python-ldap is a lightweight directory access protocol (LDAP) client API for Python. In versions prior to 3.4.5, the sanitization method `ldap.filter.escape_filter_chars` can be tricked to skip escaping of special characters when a crafted `list` or `dict` is supplied as the `assertion_value` parameter, and the non-default `escape_mode=1` is configured. The method `ldap.filter.escape_filter_chars` supports 3 different escaping modes. `escape_mode=0` (default) and `escape_mode=2` happen to raise exceptions when a `list` or `dict` object is supplied as the `assertion_value` parameter. However, `escape_mode=1` computes without performing adequate logic to ensure a fully escaped return value. If an application relies on the vulnerable method in the `python-ldap` library to escape untrusted user input, an attacker might be able to abuse the vulnerability to launch ldap injection attacks which could potentially disclose or manipulate ldap data meant to be inaccessible to them. Version 3.4.5 fixes the issue by adding a type check at the start of the `ldap.filter.escape_filter_chars` method to raise an exception when the supplied `assertion_value` parameter is not of type `str`.
📍 영향받는 시스템
python-ldap versions prior to 3.4.5
⚔️ 공격 벡터
조작된 list 또는 dict 객체를 assertion_value 파라미터로 전달하여 이스케이프 로직을 우회하는 LDAP Injection
🛡️ 대응 방법
python-ldap 라이브러리를 3.4.5 버전 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 3.4.5 미만인 경우 해당 취약점에 노출된 상태입니다.
pip show python-ldap | grep Version