🇰🇷 한글 설명
odf-kit 라이브러리의 HTML 렌더러가 인라인 CSS 문자열을 적절히 이스케이프 처리하지 않아 발생하는 취약점입니다. 공격자가 조작된 OpenDocument 파일을 통해 HTML 속성을 조기에 종료시키고 악성 스크립트를 삽입할 수 있습니다.
💡 쉬운 설명
문서 파일을 HTML로 변환할 때 특정 스타일 설정값이 안전하게 처리되지 않는 문제입니다. 이를 통해 해커가 문서 안에 몰래 악성 코드를 숨겨 실행하게 만들 수 있습니다.
🇺🇸 원문 (English)
odf-kit allows users to generate, fill, read, and convert OpenDocument Format files (.odt, .ods) in TypeScript and JavaScript. Starting in version 0.6.0 and prior to version 0.14.2, he renderer has an `escapeHtml()` helper and applies it consistently to text content and to attribute values — `href`, `src`, `alt`, `id`, `data-author`, `data-date`, citation text all go through it. The inline CSS strings do not. In `renderTextSpan` (`dist/odt/to-html/html-renderer.js:195`), the value of e.g. `fo:color` is copied from the document into `style.fontColor` verbatim by the parser (`extractSpanStyle`, read/parser.js:348), then concatenated raw into the attribute. A `"` in the value terminates the attribute early. The same unescaped `style="${...}"` pattern appears at roughly ten other emission sites: paragraph and heading (`paragraphStyleToCss`), table cells and rows (`cellStyleToCss`, `rowStyleToCss`), `<col>`, and the image style attribute. The affected source attributes include `fo:color`, `fo:background-color`, `fo:text-shadow`, `fo:letter-spacing`, `fo:font-family` (via both direct and font-face resolution), `fo:margin-*`, `fo:padding-*`, `fo:line-height`, `fo:border*`, and `style:vertical-align`. Version 0.14.2 contains a patch.
📍 영향받는 시스템
odf-kit version 0.6.0 이상 0.14.2 미만
⚔️ 공격 벡터
조작된 fo:color 등 CSS 속성 값을 포함한 ODT/ODS 파일을 생성하여 렌더링 프로세스를 공격
🛡️ 대응 방법
odf-kit 라이브러리를 최신 패치 버전인 0.14.2 이상으로 업데이트
🔧 검증 코드
출력된 버전이 0.14.2 미만(0.6.0 ~ 0.14.1)이면 취약한 상태입니다.
npm list odf-kit | grep -E 'odf-kit@([0-9]+\.[0-9]+\.[0-9]+)'