{{ message }}
Repository navigation
Commit f15d400
fix(security): 보안 검토 지적 일괄 조치 (쿼터 RPC 권한·open redirect·XSS·크리덴셜 로깅)
인증·권한
- supabase/013: 쿼터 RPC(increment/decrement_quota) EXECUTE 를 anon·authenticated
에서 회수. REVOKE 가 없어 anon 키만으로 PostgREST rpc 직접 호출이 가능했고,
decrement 반복 호출로 사전차감을 무한 환불(쿼터 우회)할 수 있었다.
- 신규 가입 admin 자동승격 제거(이메일 문자열 일치 기반) → free 고정, 수동 UPDATE.
- auth/callback: next 파라미터를 내부 경로로 제한 (open redirect, CWE-601).
- fc-rag: 대화 스토어 키를 userId 로 스코프 (conversationId 만으로 접근되던 IDOR).
크리덴셜·로그
- debug-logger: 프로덕션에서 error/warning 만 콘솔 출력 + URL 의 OC·key 마스킹.
법제처 OC 가 포함된 완성 URL 이 Vercel 로그에 평문 기록되고 있었다 (CWE-532).
- fc-rag 에러·트레이스 기록에 sanitizeCredentials 적용 (BYOK 키 누출 차단).
- scripts: 하드코딩된 법제처 OC 를 process.env.LAW_OC 로 이전.
XSS·주입
- virtualized-full-article-view: 조문 본문에 sanitizeForRender 적용. 같은 파일의
전문·부칙 경로는 정화하는데 조문만 건너뛰고 있었다. 캐시 적재 전 1회만 정화.
- annex-pdf: filename 에서 제어문자 제거 (CRLF 응답 헤더 주입, CWE-113).
- preEvidence 를 델리미터로 격리 + 펜스 무력화 (프롬프트 인젝션).
노출·남용
- ai-feedback: 무인증 쓰기에 IP 기준 분당 5회 제한 + getClientIP 사용.
- relation-graph/stats·privacy/consent: 내부 에러 메시지 클라이언트 노출 제거.
- 공개 프록시(precedent/interpretation/tax-tribunal/search-all) 입력 상한·포맷 검증.
- RELAY_TOKEN 필수화 — 미설정 시 릴레이 스킵하고 Gemini 폴백.
- article-title: 내부 origin 폴백을 고정 base URL env 우선으로 (Host 헤더 SSRF).
- log-viewer: 127.0.0.1 바인딩 + CORS 와일드카드 제거.
의존성·잔재
- protobufjs override(>=7.5.5)·vitest 4.1 — CVSS critical 2건 해소 (audit critical 0).
- 커밋돼 있던 잔재 제거: Windows 에이전트 로그, .backup_*, 기관 프록시가 발급한
*.law.go.kr 위조 체인 인증서(코드 미참조).
CSP nonce 는 기본 on 으로 바꿨다가 되돌렸다 — 프로덕션 빌드 실측에서 정적
프리렌더 HTML 의 script 36개 중 nonce 부착이 0개였고, strict-dynamic 이 전 스크립트를
차단한다. 전 페이지 동적 렌더링 전환이 선행돼야 해서 opt-in 유지하고 이유를 주석에 남김.
검증: 755 테스트 · 빌드 · 린트 통과. sanitize 회귀는 법령·조례·표 3케이스로
태그·속성·가시 텍스트 무손실 실측.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 79b36ea commit f15d400
33 files changed
Lines changed: 252 additions & 601 deletions
File tree
- %programdata%/Geni/Insights/logs
- .backup_20251102224016
- logs
- __tests__
- app
- api
- ai-feedback
- annex-pdf
- article-title
- fc-rag
- interpretation-text
- precedent-text
- privacy/consent
- relation-graph/stats
- search-all
- tax-tribunal-text
- auth/callback
- certs
- components
- settings
- lib
- fc-rag
- logs
- scripts
- supabase/migrations
This file was deleted.
Binary file not shown.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
18 | 40 | | |
19 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
20 | 47 | | |
21 | 48 | | |
22 | 49 | | |
| |||
30 | 57 | | |
31 | 58 | | |
32 | 59 | | |
33 | | - | |
34 | 60 | | |
35 | 61 | | |
36 | 62 | | |
| |||
39 | 65 | | |
40 | 66 | | |
41 | 67 | | |
42 | | - | |
| 68 | + | |
43 | 69 | | |
44 | 70 | | |
45 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||

0 commit comments