🇰🇷 한글 설명
WeGIA 3.8.7 이전 버전의 메모 디스패치 기능에서 texto 필드 처리가 안전하지 않아 저장형 DOM 크로스사이트 스크립팅(XSS) 취약점이 존재합니다. 저장 시 특수문자 필터링 후 html_entity_decode()로 복원되어 jQuery .html()로 삽입되므로 악성 스크립트가 실행될 수 있습니다. 이를 통해 관리자 세션 토큰 탈취 및 계정 장악이 가능합니다.
💡 쉬운 설명
공격자가 메모 내용에 악성 스크립트를 몰래 심어두면, 다른 사용자가 그 메모를 열 때 자동으로 실행됩니다. 이로 인해 관리자의 로그인 정보가 탈취되어 시스템 전체가 위험해질 수 있습니다.
🇺🇸 원문 (English)
WeGIA is a web manager for charitable institutions. Prior to 3.8.7, a stored DOM cross-site scripting vulnerability in `web/html/memorando/listar_despachos.php` results from unsafe handling of the `texto` field. The affected flow spans `web/controle/memorando/DespachoControle.php` and `web/dao/memorando/DespachoDAO.php`: `FILTER_SANITIZE_SPECIAL_CHARS` is applied during storage, but `html_entity_decode()` later decodes the stored content and `jQuery .html()` inserts the result into the DOM. An attacker able to submit a memorandum dispatch through `/controle/control.php` using `DespachoControle` and `metodo=incluir` can store malicious HTML or JavaScript. The code executes automatically when another user views the memorandum thread through `/html/memorando/listar_despachos.php` with `id_memorando`. This permits arbitrary JavaScript execution, theft of administrator `PHPSESSID` session tokens, privileged session hijacking, account takeover, and unauthorized access to privileged or internal functionality. This issue is fixed in version 3.8.7.
📍 영향받는 시스템
WeGIA 3.8.7 미만 버전
⚔️ 공격 벡터
/controle/control.php에서 DespachoControle(metodo=incluir)로 악성 HTML/JavaScript를 저장한 뒤, 피해자가 /html/memorando/listar_despachos.php를 열람할 때 실행
🛡️ 대응 방법
WeGIA 3.8.7 이상으로 업그레이드하고, 사용자 입력 출력 시 html_entity_decode 사용을 제거하거나 안전한 이스케이프 처리를 적용
🔧 검증 코드
결과에 html_entity_decode 호출이 출력되면 취약 코드가 남아 있는 것이므로 3.8.7 이상으로 업데이트가 필요하며, 아무 결과도 없으면 수정되었을 가능성이 높습니다.
grep -rn "html_entity_decode" /var/www/html/WeGIA/web/dao/memorando/DespachoDAO.php 2>/dev/null