🇰🇷 한글 설명
compose-lint는 배포 전에 위험한 Docker Compose 설정 오류를 찾아주는 보안 린터입니다. 0.9.0부터 0.18.0 이전 버전에서는 YAML 파서가 단독 캐리지 리턴과 유니코드 줄 구분자(U+0085, U+2028, U+2029)를 줄바꿈으로 인식하지만, 수정 위치 계산은 개행 문자만 세기 때문에 fix --apply 실행 시 선택하지 않은 다음 줄(네트워크 등 보안 설정 포함)이 삭제될 수 있습니다. 이 문제는 0.18.0에서 수정되었습니다.
💡 쉬운 설명
보안 검사 도구가 설정 파일을 자동으로 고칠 때, 특정 특수 문자가 들어 있으면 의도하지 않은 줄까지 지워질 수 있습니다. 그 결과 중요한 네트워크 보안 설정이 조용히 사라져도 도구는 성공했다고 보고할 수 있습니다.
🇺🇸 원문 (English)
compose-lint is a Docker Compose security linter that identifies dangerous misconfigurations before deployment. From 0.9.0 until 0.18.0, compose-lint's YAML parser recognizes lone carriage returns and Unicode line separators U+0085, U+2028, and U+2029 as line breaks while fix position conversion counts only newline characters. A pull request can place one of these separators in a quoted value so fix --apply shifts each later edit and deletes the line after the selected target, including an unselected network or other security setting. The resulting Compose file can remain valid, post-edit checks can pass, and the command can report a successful fix even though the dry-run diff was the only place showing the extra deletion. This issue is fixed in version 0.18.0.
📍 영향받는 시스템
compose-lint 0.9.0 이상 0.18.0 미만 버전
⚔️ 공격 벡터
악의적인 풀 리퀘스트가 따옴표 안의 값에 줄 구분 문자를 삽입해 fix --apply 실행 시 보안 설정 줄이 삭제되도록 유도
🛡️ 대응 방법
compose-lint를 0.18.0 이상으로 업데이트하고 자동 수정 적용 전 dry-run 결과를 반드시 확인
🔧 검증 코드
출력된 버전이 0.9.0 이상 0.18.0 미만이면 취약하며, 0.18.0 이상이거나 설치되어 있지 않으면 영향 없음
compose-lint --version 2>/dev/null || pip show compose-lint 2>/dev/null | grep -i version || npm ls -g compose-lint 2>/dev/null