🇰🇷 한글 설명
MarcosCamara01 이커머스 템플릿의 제품 캐시 재검증 서버 액션에서 인증 누락 취약점이 발견되었습니다. 공격자는 인증 없이 이 함수를 호출하여 전체 스토어의 제품 캐시를 강제로 만료시킬 수 있으며, 이는 데이터베이스 부하를 급증시켜 서비스 가용성을 저하시킵니다.
💡 쉬운 설명
해커가 아무런 로그인 없이도 쇼핑몰의 임시 저장된 데이터를 계속 삭제할 수 있는 문제입니다. 이로 인해 쇼핑몰이 느려지거나 데이터베이스에 과부하가 걸려 사이트가 마비될 수 있습니다.
🇺🇸 원문 (English)
Missing Authentication for Critical Function (CWE-306) in the product cache revalidation Server Action (src/app/actions.ts, revalidateProducts) in MarcosCamara01 Ecommerce Template before commit ec97209 allows a remote, unauthenticated attacker to force expiration of the entire storefront product cache at will. The file declares "use server" at file scope, so every exported function compiles into a POST-invokable Server Action; revalidateProducts calls updateTag("products") with no session or role check, unlike the read-only actions in the same file which are safe by construction. Two client components under src/components/admin import the function, which causes its Server Action id to be compiled into a public /_next/static chunk that the application's admin middleware (proxy.ts) does not gate, so any unauthenticated user can extract that id from the public bundle and invoke the action directly. With cacheComponents enabled, the entire storefront (home, categories, product pages, search) is served from "use cache" entries produced by getAllProducts, getCategoryProducts and getProduct, all tagged products with an hours-long cacheLife. Repeated unauthenticated invocation of revalidateProducts keeps that cache permanently cold, forcing every visitor's request to read the full product catalog from Postgres instead of serving from cache, degrading storefront availability at near-zero attacker cost.
📍 영향받는 시스템
MarcosCamara01 Ecommerce Template (commit ec97209 이전 버전)
⚔️ 공격 벡터
공개된 클라이언트 번들에서 Server Action ID를 추출하여 인증 없이 POST 요청으로 직접 호출
🛡️ 대응 방법
revalidateProducts 함수 내에 세션 및 권한 확인 로직을 추가하고, 관리자 전용 액션이 공개 번들에 포함되지 않도록 수정
🔧 검증 코드
인증 토큰 없이 해당 Server Action ID로 POST 요청을 보냈을 때 성공 응답(200 OK)이 오면 취약한 상태임
curl -X POST -s https://<target-domain>/_next/data/ <action-id> && echo 'Check response status'
💻 영향받는 소프트웨어
IBM WebSphere Application Server