Skip to content

fix: CodeQL 보안 취약점 8건 수정#262

Merged
sdk-kr merged 4 commits into
damoang:mainfrom
unstable-code:fix/security-code-scanning-alerts
Mar 6, 2026
Merged

fix: CodeQL 보안 취약점 8건 수정#262
sdk-kr merged 4 commits into
damoang:mainfrom
unstable-code:fix/security-code-scanning-alerts

Conversation

@unstable-code
Copy link
Copy Markdown
Collaborator

@unstable-code unstable-code commented Mar 5, 2026

Summary

  • CodeQL Code Scanning에서 탐지된 보안 취약점 8건 수정
  • 수정 검증을 위한 단위 테스트 39건 추가 (vitest 181건 전체 통과)

수정 내역

Alert 규칙 파일 수정 방법
69, 70 Double escaping amazon.ts, kkday.ts 체이닝 .replace() → 단일 패스 정규식
66, 67, 68 Incomplete URL substring sanitization coupang.ts, aliexpress.ts .includes()new URL() hostname 검증
71, 65 Incomplete multi-character sanitization new-posts.ts, activity/+server.ts 체이닝 entity 디코딩 → 단일 패스
63 Incomplete multi-character sanitization content-transform.ts 태그 제거 loop-until-stable

미해결 (Trivy 4건)

  • Alert 72~75: Docker 베이스 이미지 내장 npm 패키지(tar, minimatch) 취약점
  • 최신 node:lts-alpine에도 아직 패치 미포함 — npm upstream 릴리스 대기

Test plan

  • pnpm vitest run --project server 전체 통과 (181/181)
  • CodeQL 재스캔으로 알림 해소 확인

🤖 Generated with Claude Code

unstable-code and others added 3 commits March 6, 2026 07:49
- content-transform: 중첩 태그 제거, 동영상 URL 변환
- html-entity-decode: 이중 언이스케이프 방지, XSS 방지
- url-hostname-validation: 부분문자열 도메인 위장 차단

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- #69,#70 Double escaping: 단일 패스 entity 디코딩 (amazon, kkday)
- #66,#67,#68 URL substring sanitization: hostname 파싱 검증 (coupang, aliexpress)
- #71,#65 Incomplete multi-char sanitization: 단일 패스 디코딩 (new-posts, activity)
- #63 Incomplete tag stripping: loop-until-stable 방식 (content-transform)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@sdk-kr sdk-kr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 감사합니다.

content-transform.test.ts 충돌 해결: main의 코드블록 테스트와
PR 브랜치의 보안 테스트를 모두 병합
@sdk-kr sdk-kr marked this pull request as ready for review March 6, 2026 08:33
@sdk-kr sdk-kr merged commit e733a7b into damoang:main Mar 6, 2026
8 of 12 checks passed
@unstable-code unstable-code deleted the fix/security-code-scanning-alerts branch March 6, 2026 08:38
sdk-kr pushed a commit that referenced this pull request Mar 7, 2026
## Summary
- CodeQL Code Scanning에서 탐지된 보안 취약점 8건 수정
- 수정 검증을 위한 단위 테스트 39건 추가 (vitest 181건 전체 통과)

## 수정 내역

| Alert | 규칙 | 파일 | 수정 방법 |
|-------|------|------|-----------|
| [69](https://github.com/damoang/angple/security/code-scanning/69),
[70](https://github.com/damoang/angple/security/code-scanning/70) |
Double escaping | amazon.ts, kkday.ts | 체이닝 `.replace()` → 단일 패스 정규식 |
| [66](https://github.com/damoang/angple/security/code-scanning/66),
[67](https://github.com/damoang/angple/security/code-scanning/67),
[68](https://github.com/damoang/angple/security/code-scanning/68) |
Incomplete URL substring sanitization | coupang.ts, aliexpress.ts |
`.includes()` → `new URL()` hostname 검증 |
| [71](https://github.com/damoang/angple/security/code-scanning/71),
[65](https://github.com/damoang/angple/security/code-scanning/65) |
Incomplete multi-character sanitization | new-posts.ts,
activity/+server.ts | 체이닝 entity 디코딩 → 단일 패스 |
| [63](https://github.com/damoang/angple/security/code-scanning/63) |
Incomplete multi-character sanitization | content-transform.ts | 태그 제거
loop-until-stable |

## 미해결 (Trivy 4건)
- Alert 72~75: Docker 베이스 이미지 내장 npm 패키지(`tar`, `minimatch`) 취약점
- 최신 `node:lts-alpine`에도 아직 패치 미포함 — npm upstream 릴리스 대기

## Test plan
- [x] `pnpm vitest run --project server` 전체 통과 (181/181)
- [ ] CodeQL 재스캔으로 알림 해소 확인

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Deploy Bot <deploy@damoang.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants