🇰🇷 한글 설명
Gatsby 프레임워크의 gatsby-transformer-remark 플러그인에서 발생하는 취약점으로, 입력값이 적절히 검증되지 않을 경우 gray-matter 패키지를 통해 JavaScript 주입 공격이 가능합니다. 이 취약점을 이용하면 빌드 서버 환경에서 악성 코드가 실행될 수 있습니다.
💡 쉬운 설명
웹사이트를 만드는 도구의 특정 기능에 검증되지 않은 코드를 넣으면, 서버가 이를 실행해 버리는 보안 구멍이 발견되었습니다. 해커가 이 구멍을 통해 서버를 조종하거나 정보를 빼낼 수 있습니다.
🇺🇸 원문 (English)
Gatsby is a free and open source framework based on React that helps developers build websites and apps. The gatsby-transformer-remark plugin prior to versions 5.25.1 and 6.3.2 passes input through to the `gray-matter` npm package, which is vulnerable to JavaScript injection in its default configuration, unless input is sanitized. The vulnerability is present in gatsby-transformer-remark when passing input in data mode (querying MarkdownRemark nodes via GraphQL). Injected JavaScript executes in the context of the build server. To exploit this vulnerability untrusted/unsanitized input would need to be sourced by or added into a file processed by gatsby-transformer-remark. A patch has been introduced in `
[email protected]` and `
[email protected]` which mitigates the issue by disabling the `gray-matter` JavaScript Frontmatter engine. As a workaround, if an older version of `gatsby-transformer-remark` must be used, input passed into the plugin should be sanitized ahead of processing. It is encouraged for projects to upgrade to the latest major release branch for all Gatsby plugins to ensure the latest security updates and bug fixes are received in a timely manner.
📍 영향받는 시스템
gatsby-transformer-remark versions prior to 5.25.1 and 6.3.2
⚔️ 공격 벡터
검증되지 않은 외부 입력값이 MarkdownRemark 노드를 통해 플러그인으로 전달되어 JavaScript가 실행됨
🛡️ 대응 방법
gatsby-transformer-remark를 5.25.1 또는 6.3.2 이상의 버전으로 업데이트하거나 입력값을 사전 검증함
🔧 검증 코드
출력된 버전이 5.25.1 또는 6.3.2 미만인지 확인하여 취약 여부를 판단합니다.
npm list gatsby-transformer-remark