🇰🇷 한글 설명
Astro 웹 프레임워크의 Netlify 어댑터에서 이미지 원격 패턴을 정규식으로 변환할 때 경로(pathname) 내의 특수 문자를 적절히 이스케이프하지 않는 취약점이 발견되었습니다. 이로 인해 특정 경로를 제한하더라도 정규식 메타 문자를 이용해 허용되지 않은 경로의 이미지까지 최적화할 수 있습니다. 이 문제는 버전 8.1.2에서 수정되었습니다.
💡 쉬운 설명
웹사이트에서 특정 이미지 주소만 허용하도록 설정했음에도 불구하고, 공격자가 특수 기호를 사용하여 허용되지 않은 다른 이미지 주소까지 불러올 수 있는 문제입니다. 이를 통해 보안 설정이 의도치 않게 우회될 수 있습니다.
🇺🇸 원문 (English)
Astro is a web framework for content-driven websites. Prior to 8.1.2, the Astro Netlify adapter converts each image.remotePatterns entry into a regular expression written to .netlify/v1/config.json under images.remote_images for Netlify's Image CDN allowlist. In packages/integrations/netlify/src/index.ts, remotePatternToRegex() escapes dots in hostname values but interpolates literal pathname values without escaping regular expression metacharacters such as ., +, ?, (, and [, so a restrictive pathname such as /img/v1.0/file also matches metacharacter-adjacent paths, including paths that cross a segment. Netlify enforces the generated regular expression directly and Astro's matchPattern() helper does not revalidate the request, allowing optimization of images on an already-allowed host that the declared pathname was intended to exclude. This issue is fixed in version 8.1.2.
📍 영향받는 시스템
Astro Netlify adapter (version 8.1.2 미만)
⚔️ 공격 벡터
정규식 메타 문자를 포함한 조작된 경로(pathname)를 사용하여 허용된 호스트 내의 제한된 경로를 우회함
🛡️ 대응 방법
Astro를 최신 버전인 8.1.2 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 8.1.2 미만이면 취약한 상태이며, 8.1.2 이상이면 안전합니다.
npm list @astrojs/netlify 2>/dev/null | grep -E '@astrojs/netlify'