🇰🇷 한글 설명
Vendure 헤드리스 커머스 플랫폼의 Shop API에서 인증 없이 악용 가능한 SQL injection 취약점입니다. languageCode 쿼리 매개변수가 검증 없이 SQL에 직접 삽입되어 모든 지원 데이터베이스에서 임의의 SQL 명령을 실행할 수 있습니다.
💡 쉬운 설명
Vendure 온라인 상점에서 특수한 입력으로 데이터베이스를 마음대로 조종할 수 있습니다. 로그인 없이 고객 정보, 주문, 상품 데이터를 모두 접근하거나 삭제할 수 있습니다.
🇺🇸 원문 (English)
Vendure is an open-source headless commerce platform. Starting in version 1.7.4 and prior to versions 2.3.4, 3.5.7, and 3.6.2, an unauthenticated SQL injection vulnerability exists in the Vendure Shop API. A user-controlled query string parameter is interpolated directly into a raw SQL expression without parameterization or validation, allowing an attacker to execute arbitrary SQL against the database. This affects all supported database backends (PostgreSQL, MySQL/MariaDB, SQLite). The Admin API is also affected, though exploitation there requires authentication. Versions 2.3.4, 3.5.7, and 3.6.2 contain a patch. For those who are unable to upgrade immediately, Vendure has made a hotfix available that uses `RequestContextService.getLanguageCode` to validate the `languageCode` input at the boundary. This blocks injection payloads before they can reach any query. The hotfix replaces the existing `getLanguageCode` method in `packages/core/src/service/helpers/request-context/request-context.service.ts`. Invalid values are silently dropped and the channel's default language is used instead. The patched versions additionally convert the vulnerable SQL interpolation to a parameterized query as defense in depth.
📍 영향받는 시스템
Vendure 1.7.4 ~ 2.3.3, 3.5.0 ~ 3.5.6, 3.6.0 ~ 3.6.1 (PostgreSQL, MySQL/MariaDB, SQLite)
⚔️ 공격 벡터
languageCode 쿼리 파라미터에 SQL injection 페이로드 삽입하여 Shop API 요청 시 임의 SQL 실행
🛡️ 대응 방법
Vendure 2.3.4, 3.5.7, 3.6.2 이상으로 업그레이드하거나 RequestContextService.getLanguageCode 메서드 hotfix 적용
🔧 검증 코드
Vendure 소스코드에서 languageCode 처리 방식을 확인하여 파라미터화된 쿼리(parameterized query) 사용 여부를 검증합니다.
grep -r 'languageCode' /path/to/vendure/packages/core/src/service --include='*.ts' | head -1