🇰🇷 한글 설명
Dolibarr 24.0.0 미만 버전의 CSV 및 XLSX 가져오기 마법사에서 SQL 인젝션 취약점이 발견되었습니다. 공격자는 부적절한 필터링을 악용하여 데이터베이스 쿼리를 조작함으로써 임의의 데이터를 유출하거나 특정 행의 내용을 덮어쓸 수 있습니다.
💡 쉬운 설명
데이터를 불러오는 기능에서 입력값 검증이 제대로 되지 않아 발생하는 보안 문제입니다. 해커가 악성 명령어를 입력하면 데이터베이스에 저장된 중요한 정보를 빼내거나 내용을 마음대로 바꿀 수 있습니다.
🇺🇸 원문 (English)
Dolibarr before 24.0.0 contains a SQL injection in its CSV and XLSX import wizard. The wizard reads its update keys with GETPOST('updatekeys', 'array') in htdocs/imports/import.php, which applies only the generic alphanohtml filter: that strips HTML but leaves SQL keywords, comment markers, parentheses, spaces and quotes intact. import_insert() in htdocs/core/modules/import/import_csv.modules.php then iterates the submitted values and builds a filter with $where[] = $key.' = '.$data[$key], having first applied preg_replace('/^.*\./i', '', $key), an alias strip that does nothing to a value containing no dot. The assembled string is executed through $this->db->query(). The injected SELECT resolves the row id that the import then assigns to $lastinsertid, which becomes the WHERE target of a subsequent UPDATE, so a UNION SELECT returning an attacker-chosen integer both exfiltrates arbitrary table content and redirects which row the import overwrites; for category link tables the raw filter array is spliced into that UPDATE directly. The interface offers a fixed list of legitimate column codes but the server never checks the submitted values against it. A user holding the import permission can exploit this. Release 23.0.4 does not carry the fix; the allow-list test was added in 24.0.0.
📍 영향받는 시스템
Dolibarr versions before 24.0.0 (Note: 23.0.4 is also vulnerable)
⚔️ 공격 벡터
가져오기 마법사의 'updatekeys' 파라미터에 조작된 SQL 구문을 삽입하여 공격
🛡️ 대응 방법
Dolibarr를 최신 보안 패치가 적용된 24.0.0 이상의 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 dolibarr_version 값이 24.0.0 미만이면 취약한 상태입니다.
php -r "echo 'Dolibarr version check required';" && curl -s http://<target_ip>/docs/version.inc.php | grep -E 'dolibarr_version'