🇰🇷 한글 설명
github.com/gomarkdown/markdown 라이브러리의 parser.IsSafeURL 함수에서 슬라이스 범위 초과로 인한 패닉(Panic)이 발생할 수 있는 취약점입니다. 공격자가 조작된 URL을 입력할 경우 프로그램이 예기치 않게 종료되어 서비스 거부(DoS) 상태를 유발할 수 있습니다.
💡 쉬운 설명
마크다운 문서를 변환할 때 특정 링크 주소를 잘못 처리하여 프로그램이 갑자기 꺼지는 문제입니다. 악의적인 링크를 포함한 문서를 읽게 만들면 웹사이트 서비스가 중단될 수 있습니다.
🇺🇸 원문 (English)
The package github.com/gomarkdown/markdown is a Go library for parsing Markdown text and rendering as HTML. Prior to 0.0.0-20260724235538-61af6e1e6971, parser.IsSafeURL in parser/parser.go slices url[:nPath] before the len(url) >= nPath guard. A short destination causes a slice-bounds panic when the loop reaches a relative-path prefix for which len(url) < nPath and cap(url) < nPath. The one-byte destination / is an explicit non-panic counterexample because it matches the first valid path and returns before a longer prefix is sliced. Demonstrated panic cases include empty, ., and .. destinations under those conditions. The panic is reachable when markdown.ToHTML renders untrusted Markdown with html.Safelink enabled, including an empty link destination, and is also reachable by callers that pass a short attacker-controlled URL directly to the exported parser.IsSafeURL function. An uncaught panic can terminate the calling process and cause denial of service. This issue is fixed in 0.0.0-20260724235538-61af6e1e6971.
📍 영향받는 시스템
github.com/gomarkdown/markdown 버전 0.0.0-20260724235538-61af6e1e6971 미만
⚔️ 공격 벡터
html.Safelink가 활성화된 상태에서 조작된 URL이 포함된 마크다운을 렌더링하거나 parser.IsSafeURL 함수에 직접 전달
🛡️ 대응 방법
라이브러리를 0.0.0-20260724235538-61af6e1e6971 버전 이상으로 업데이트
🔧 검증 코드
출력된 버전 정보가 0.0.0-20260724235538-61af6e1e6971보다 낮은지 확인
go list -m github.com/gomarkdown/markdown