Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@
**Vulnerability:** A custom buffer length check (`if (signatureBytes.length !== expectedSignatureBytes.length) return false`) before calling `crypto.timingSafeEqual()` leaked the length of the expected signature, enabling timing attacks.
**Learning:** Never use custom 'homebrew' buffer-padding logic to match lengths for `crypto.timingSafeEqual()`, as early returns leak the length of the secret.
**Prevention:** Ensure inputs are hashed to a uniform length (e.g., using `crypto.createHash('sha256')`) before comparison.

## 2025-07-25 - [ERD μ—”μ§€λ‹ˆμ–΄λ§ 도ꡬ λ‚΄ DDL 생성 μ‹œ SQL μΈμ μ…˜ λ°©μ§€]
**Vulnerability:** ERD 도ꡬ(`packages/web/src/lib/erd.ts`)의 DDL 생성 κΈ°λŠ₯μ—μ„œ, 컬럼 νƒ€μž…(`column.type`) 값에 λŒ€ν•œ 검증이 λΆ€μ‘±ν•˜μ—¬ μ‚¬μš©μžκ°€ μ˜λ„μ μœΌλ‘œ μ„Έλ―Έμ½œλ‘ (`;`) 등을 μ£Όμž…ν•΄ μ—¬λŸ¬ 개의 μ•…μ˜μ μΈ SQL 문을 μ‹€ν–‰ν•˜λ„λ‘ μ‘°μž‘ν•  수 μžˆμ—ˆμŠ΅λ‹ˆλ‹€ (예: `integer; DROP TABLE users;`).
**Learning:** λ°μ΄ν„°λ² μ΄μŠ€ μŠ€ν‚€λ§ˆ 생성 및 SQL을 λ™μ μœΌλ‘œ 쑰립할 λ•Œ μ‚¬μš©μž μž…λ ₯을 μžˆλŠ” κ·ΈλŒ€λ‘œ μ—°κ²°(concatenate)ν•˜λ©΄ μ»€λ§¨λ“œ μΈμ μ…˜ λ˜λŠ” SQL μΈμ μ…˜ μœ„ν—˜μ΄ μžˆμŠ΅λ‹ˆλ‹€. 특히 DDLλ¬Έμ—μ„œλŠ” Prepared Statementλ₯Ό μ μš©ν•  수 μ—†λŠ” κ²½μš°κ°€ λ§Žμ•„, μž…λ ₯값에 λŒ€ν•œ λͺ…μ‹œμ μΈ ν™”μ΄νŠΈλ¦¬μŠ€νŠΈ 기반의 κ²€μ¦μ΄λ‚˜ μ² μ €ν•œ μ œν•œ(μ„Έλ―Έμ½œλ‘  차단 λ“±)이 ν•„μˆ˜μ μž…λ‹ˆλ‹€.
**Prevention:** μ‚¬μš©μžλ‘œλΆ€ν„° μ œκ³΅λ˜λŠ” 컬럼λͺ…μ΄λ‚˜ νƒ€μž… 정보에 ꡬ문 μ’…λ£Œλ₯Ό μ˜λ―Έν•˜λŠ” μ„Έλ―Έμ½œλ‘ κ³Ό 같은 메타 λ¬Έμžκ°€ ν¬ν•¨λ˜μ§€ μ•Šλ„λ‘ 좔가적인 νƒ€μž… 검증(예: `column.type.includes(';')`)을 μ‹€μ‹œν•˜μ—¬ DDL 생성 λ‘œμ§μ„ λ³΄ν˜Έν•΄μ•Ό ν•©λ‹ˆλ‹€.
Loading
Loading