feat: 큐레이션 데이터 품질 개선 (description, thumbnailUrl 추출)#28
Merged
Conversation
P1 #8: 큐레이션 봇 크롤러 데이터 품질 개선 주요 변경사항: - RSS 피드에서 description, thumbnailUrl 필드 추출 - feed-parser 공유 유틸리티 생성 (extractFeedItems, sanitizeDescription, extractOgImage) - SSRF 보호 강화 (isSafeUrl를 url-validator로 이동) - HTML 엔티티 디코딩 추가 (html-entities 패키지) - 제어 문자/유니코드 익스플로잇 제거 로직 개선 - 웹 API와 봇 간 코드 중복 제거 보안 개선: - extractOgImage 함수에 isSafeUrl SSRF 체크 추가 - sanitizeDescription에 제어 문자/유니코드 익스플로잇 제거 추가 - 내부 URL (localhost, 127.0.0.1, 169.254.169.254 등) 차단 테스트: - feed-parser.property.test.ts 추가 (20개 테스트 케이스) - SSRF 보호, XSS 방지, 한글/이모지 처리 등 검증 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- 봇 스케줄러: Promise.allSettled로 OG 이미지 동시 추출 - 웹 API: OG 이미지 병렬 추출 후 DB 삽입 (순차 유지) - 순차 처리(최대 250초) → 병렬 처리(최대 5초)로 대기 시간 단축 - Promise.allSettled로 개별 실패시 전체 프로세스 보호 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 웹 API: NormalizedFeedItem 타입 import 추가 - filter/map 콜백에 명시적 타입 어노테이션 추가 - Promise.allSettled 결과에 타입 가드 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- shared/utils: utils namespace export 추가 (import { utils } 패턴 지원)
- rss-detect.ts: isSafeUrl re-export 추가
- 타입 안전성 개선: Promise.allSettled result 변수 분리
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Summary
🔴 AS-IS
extractOgImage함수에 SSRF 보호 체크 누락sanitizeDescription구현이 두 곳에서 다르게 동작 (HTML 엔티티 처리 불일치)🟢 TO-BE
feed-parser.ts공유 유틸리티로 코드 중복 제거extractOgImage에isSafeUrl체크 추가 (내부 URL 차단)💬 참고사항
주요 변경사항
공유 유틸리티 생성:
packages/shared/src/utils/feed-parser.tsextractFeedItems(): RSS/Atom/JSON/RDF 포맷 통합 파싱sanitizeDescription(): HTML 태그 제거 + 보안 위험 요소 필터링 + 엔티티 디코딩extractOgImage(): OG 이미지 추출 + SSRF 보호보안 강화
isSafeUrl()을url-validator.ts로 이동하여 봇/웹 공용으로 사용localhost,127.0.0.1,169.254.169.254(AWS 메타데이터),10.x,192.168.x[\x00-\x08\x0B\x0C\x0E-\x1F\x7F][\u200B-\u200F\u202A-\u202E\u2060-\u2064\uFEFF]데이터베이스 스키마
curation_items테이블에description,thumbnailUrl컬럼 이미 존재description TEXT,thumbnailUrl VARCHAR(1000)의존성 추가
feedsmith@2.9.0(업데이트)html-entities@2.6.0(신규)테스트
주의사항
🤖 Generated with Claude Code