fix+security(테이블타입): bug hunt 6건 + 인가/SQL injection 2건 #13

Merged
johngreen merged 2 commits from johngreen into main 2026-05-13 09:08:12 +00:00
Contributor

요약

bug hunt review 4명 (debugger + security-reviewer + architect + code-reviewer) 발견 사항 fix.

2 commit

1. fix(테이블타입): bug hunt 6건 (B1~B6) — 420b92bc

  • B1 CRITICAL: DdlService.convertToInputType 에 file/image/numbering case 추가 — 운영 functional 버그 (사용자가 파일/이미지/채번 선택해도 silent text 저장)
  • B2 MAJOR: updateColumnSettings null check (500 에러 방지)
  • B3 MAJOR: TableSettingModal 'direct' default → 'text' (bom.status 의 'direct' 표시 원인)
  • B4 UX: TypeOverviewStrip Legacy 합산 칩 (V0 의 1,209 legacy row 가시화)
  • B5 DRY: USER_SELECTABLE_INPUT_TYPES 공통 상수 추출 (InputTypeConstants 신설)
  • B6 type safety: context flag enum 화 (InputTypeContext 신설)

2. security(테이블타입): 인가 + SQL injection — efea906e

  • OWASP A01 Broken Access Control: TableManagementController 15개 write/DDL endpoint 인가 추가
    • SUPER_ADMIN 전용 5건 (DDL): primary-key/indexes/nullable/unique/log
    • admin (COMPANY_ADMIN+) 10건: updateColumnSettings/addTableData/editTableData/deleteTableData/multi-save 등
    • read 19건 그대로 (일반 사용자 접근 유지)
  • OWASP A03 Injection: createLogTable SQL injection 강화
    • ALLOWED_LOG_COLUMN_TYPES 화이트리스트 21개
    • sanitize 빈 식별자 차단 + 원본 컬럼 검증
    • 알 수 없는 type → text 안전 대체

검증

  • Backend gradle compileJava BUILD SUCCESSFUL
  • mapper XML 0건 변경 (READ 경로 mapper 5곳 보호 유지)
  • frontend grep 자체 검증
  • ⚠️ frontend tsc 자동 실행 못 함 (CI 빌드로 검증)

별도 후속 (본 PR scope 외)

  • k8s/secrets-real.yaml + configmap.yaml 평문 secret git 노출 → secret rotate + history purge 필요
  • CORS wildcard + credentials 결합
  • FieldType union 에 numbering/image/category 누락 (FieldRenderer silent fallback)

🤖 Generated with Claude Code

## 요약 bug hunt review 4명 (debugger + security-reviewer + architect + code-reviewer) 발견 사항 fix. ## 2 commit ### 1. fix(테이블타입): bug hunt 6건 (B1~B6) — `420b92bc` - **B1 CRITICAL**: DdlService.convertToInputType 에 file/image/numbering case 추가 — 운영 functional 버그 (사용자가 파일/이미지/채번 선택해도 silent text 저장) - **B2 MAJOR**: updateColumnSettings null check (500 에러 방지) - **B3 MAJOR**: TableSettingModal 'direct' default → 'text' (bom.status 의 'direct' 표시 원인) - **B4 UX**: TypeOverviewStrip Legacy 합산 칩 (V0 의 1,209 legacy row 가시화) - **B5 DRY**: USER_SELECTABLE_INPUT_TYPES 공통 상수 추출 (InputTypeConstants 신설) - **B6 type safety**: context flag enum 화 (InputTypeContext 신설) ### 2. security(테이블타입): 인가 + SQL injection — `efea906e` - **OWASP A01 Broken Access Control**: TableManagementController 15개 write/DDL endpoint 인가 추가 - SUPER_ADMIN 전용 5건 (DDL): primary-key/indexes/nullable/unique/log - admin (COMPANY_ADMIN+) 10건: updateColumnSettings/addTableData/editTableData/deleteTableData/multi-save 등 - read 19건 그대로 (일반 사용자 접근 유지) - **OWASP A03 Injection**: createLogTable SQL injection 강화 - ALLOWED_LOG_COLUMN_TYPES 화이트리스트 21개 - sanitize 빈 식별자 차단 + 원본 컬럼 검증 - 알 수 없는 type → text 안전 대체 ## 검증 - ✅ Backend gradle compileJava BUILD SUCCESSFUL - ✅ mapper XML 0건 변경 (READ 경로 mapper 5곳 보호 유지) - ✅ frontend grep 자체 검증 - ⚠️ frontend tsc 자동 실행 못 함 (CI 빌드로 검증) ## 별도 후속 (본 PR scope 외) - k8s/secrets-real.yaml + configmap.yaml 평문 secret git 노출 → secret rotate + history purge 필요 - CORS wildcard + credentials 결합 - FieldType union 에 numbering/image/category 누락 (FieldRenderer silent fallback) 🤖 Generated with Claude Code
johngreen added 2 commits 2026-05-13 09:08:10 +00:00
review 4명 (debugger + security-reviewer + architect + code-reviewer) 발견:

- B1 [CRITICAL]: DdlService.convertToInputType 에 file/image/numbering case 추가
  - 사용자가 파일/이미지/채번 선택해도 silent text 저장되던 버그
  - 박창현 image 2 의 8개 중 3개가 운영에서 작동 안 함
- B2 [MAJOR]: TableManagementService.updateColumnSettings null check
  - settings 에 input_type 키만 있고 값 null 일 때 500 에러 방지
- B3 [MAJOR]: TableSettingModal.tsx 'direct' default → 'text'
  - 운영의 bom.status 같은 컬럼이 UI 에 'direct' 표시되던 원인 제거
- B4 [MINOR/UX]: TypeOverviewStrip 에 Legacy 합산 칩 추가
  - V0 의 legacy 1,209 row (category 888 외) 가 strip 에서 보이도록 amber 칩 + 도넛 호
- B5 [DRY]: USER_SELECTABLE_INPUT_TYPES 공통 상수 추출
  - TableManagementService:30 + DdlService:43 중복 → InputTypeConstants 신설
- B6 [type safety]: context flag enum 화
  - 'user-insert'/'user-update-type'/'user-update-other'/'system-normalize' string → InputTypeContext enum
  - typo silent fail 차단

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bug hunt security-reviewer 발견 2건 보안 fix:

1. TableManagementController 인가 누락 (OWASP A01 Broken Access Control)
   - 15개 write/DDL endpoint 가 admin role 검증 없이 JWT 만 있으면 호출 가능
   - 일반 사용자가 PK 재설정/index 변경/컬럼 수정 가능했음
   - 조치:
     - DepartmentController 의 isAdmin/isSuperAdmin helper 패턴 복사
     - SUPER_ADMIN 전용 (DDL 5건): primary-key, indexes, nullable, unique, log
     - admin (COMPANY_ADMIN+) (10건): updateColumnSettings, addTableData, editTableData, deleteTableData, multi-save 등
     - read 19건은 그대로 (일반 사용자 접근 유지, company_code 격리만)

2. createLogTable SQL injection (OWASP A03 Injection)
   - information_schema.data_type 을 raw concat 으로 DDL 생성
   - 조치:
     - ALLOWED_LOG_COLUMN_TYPES Set 으로 화이트리스트 (varchar/text/integer/numeric/boolean/date/timestamp/jsonb 등 21개)
     - sanitize 빈 식별자 차단 + 원본 테이블에 없는 컬럼 skip
     - colDefs empty 시 IllegalArgumentException
     - 알 수 없는 type 은 text 로 안전 대체

검증:
- gradle compileJava BUILD SUCCESSFUL
- mapper XML 0건 변경 (READ 경로 보호)
- 별도 미해결 보안 이슈 (k8s secrets git 노출, CORS 와일드카드 등) 는 본 PR scope 외

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
johngreen merged commit ff4033b927 into main 2026-05-13 09:08:12 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gbpark/invyone#13