🇰🇷 한글 설명
CI4MS는 CodeIgniter 4 기반 콘텐츠 관리 시스템 스켈레톤입니다. 0.31.9.0 이전 버전에서는 블로그 본문 정화에 사용되는 커스텀 html_purify 검증 규칙이 참조 전달(?string &$str) 방식에 의존하는데, CodeIgniter 4 검증기는 값의 사본을 전달하므로 정화된 텍스트가 무시되어 저장형 XSS가 발생합니다. 정화되지 않은 내용이 공개 템플릿에서 이스케이프 없이 출력되어 방문자와 최고관리자의 브라우저에서 스크립트가 실행될 수 있습니다.
💡 쉬운 설명
블로그 글에 악성 스크립트를 넣으면 이를 본 다른 사람의 브라우저에서 그 스크립트가 실행될 수 있습니다. 특히 관리자가 글을 미리보거나 편집할 때 피해를 입을 수 있습니다.
🇺🇸 원문 (English)
CI4MS is a CodeIgniter 4-based content management system skeleton. Prior to version 0.31.9.0, the custom `html_purify` validation rule used to sanitize blog post bodies relies on by-reference mutation (`?string &$str`), but CodeIgniter 4's validator passes a local copy of the value, so the sanitized text is silently discarded. The Blog controller writes `$lanData['content']` directly into `blog_langs.content`, and the public template echoes it without escaping — yielding stored XSS executable in any visitor's browser, including the superadmin when previewing or editing posts. Version 0.31.9.0 patches the issue.
📍 영향받는 시스템
CI4MS 0.31.9.0 미만 버전
⚔️ 공격 벡터
블로그 게시글 본문에 악성 자바스크립트를 삽입해 저장하면, 이를 열람하는 방문자나 관리자의 브라우저에서 실행됨
🛡️ 대응 방법
CI4MS를 0.31.9.0 이상으로 업그레이드하고, 기존 게시글의 본문에 삽입된 스크립트 여부를 점검
🔧 검증 코드
결과에 html_purify 규칙 정의가 나타나고 해당 함수가 ?string &$str 형태로 참조 전달을 사용하면 취약 버전이며, 설치된 버전은 composer.json 또는 릴리스 정보에서 0.31.9.0 이상인지 별도로 확인해야 합니다
grep -rn "html_purify" app/ 2>/dev/null | head -5