fix(security): outbound URL 내부주소·host 검증 전수 강화

서버가 외부 입력으로 목적지가 제어되는 outbound HTTP 요청을 보내는 지점을
전수 조사해, 내부망(사설 IP·루프백·링크로컬·메타데이터)과 host 위조를 차단한다.
KVE-2026-1546(이니시스 인증 URL 접두사 매칭 우회)과 동일 클래스의
지점(언어팩 URL 설치, 스케줄 URL 호출, 배송비 계산 API, GitHub URL 판정)을
코어 공용 유틸 App\Support\OutboundUrlValidator 로 수렴시켰다.

- 접두사 매칭을 host 완전일치로 교체 — userinfo(@) 위장과 접미사 확장 도메인
 우회 벡터 차단.
- 사내 서버 호출이 정당한 관리자 지점(스케줄·외부 API)은 신규 설정
 security.allow_internal_outbound_urls(기본 off)로 옵트인.
- 언어팩 URL 설치는 원격 코드 다운로드라 옵트인과 무관하게 내부 주소 항상 차단.
- 웹소켓 연결 테스트는 localhost·사설 IP 가 정상 구성이므로 구조적 위조만 차단.

각 지점에 red 재현 → 수정 → green 회귀 테스트 + 실브라우저 E2E 로 검증.
수기 API 문서가 자동 재생성으로 소실되는 사고를 막는 PreToolUse 훅을 함께 추가한다.
This commit is contained in:
HeuJung committed 2026-07-14 09:17:00 +09:00
1 parent f848086fd6
commit c4beb116ad
46 files changed
+1297 -55

No files matched your search

@@ -8,6 +8,8 @@
### Added
- 환경설정 > 보안 화면에 "내부 네트워크 주소 호출 허용" 항목이 추가되었습니다. 예약 작업의 주소 호출이나 외부 API 연동에서 사내 서버 주소를 사용해야 할 때 켜면 됩니다. 기본값은 꺼짐입니다.
- 레이아웃 편집기에서 관리자 기본 레이아웃을 편집할 때 "모바일 메뉴 펼침" 상태를 선택할 수 있습니다 — 모바일 메뉴 안의 언어·통화·배송국가 버튼을 캔버스에서 바로 편집할 수 있습니다.
### Changed
@@ -1431,6 +1431,8 @@
"desc": "Manage site security settings.",
"force_https": "Force HTTPS",
"force_https_desc": "Force all connections to use HTTPS.",
"allow_internal_outbound_urls": "Allow internal network addresses",
"allow_internal_outbound_urls_desc": "Allows private IPs and localhost to be used for outbound calls such as external API integrations and scheduled URL calls. Turn this on only when you need to reach servers inside your own network. It lets the server send requests to your internal network, so it is off by default.",
"login_attempt_limit": "Login Attempt Limit",
"login_attempt_limit_desc": "Lock account after certain number of failed login attempts.",
"auth_token_lifetime": "Auth Token Lifetime (minutes)",
@@ -1435,6 +1435,8 @@
"desc": "사이트 보안 관련 설정을 관리합니다.",
"force_https": "HTTPS 강제 적용",
"force_https_desc": "모든 연결을 HTTPS로 강제합니다.",
"allow_internal_outbound_urls": "내부 네트워크 주소 호출 허용",
"allow_internal_outbound_urls_desc": "외부 API 연동·스케줄 URL 호출 등에서 사설 IP나 localhost 같은 내부 주소를 사용할 수 있게 합니다. 사내 서버를 호출해야 할 때만 켜세요. 켜면 서버가 내부망으로 요청을 보낼 수 있게 되므로 기본값은 꺼짐입니다.",
"login_attempt_limit": "로그인 시도 제한",
"login_attempt_limit_desc": "일정 횟수 이상 로그인 실패 시 계정을 잠급니다.",
"auth_token_lifetime": "인증 토큰 유지시간 (분)",
@@ -106,6 +106,65 @@
}
]
},
{
"id": "toggle_allow_internal_outbound_urls",
"type": "basic",
"name": "Div",
"props": {
"className": "flex-between"
},
"children": [
{
"type": "basic",
"name": "Div",
"children": [
{
"type": "basic",
"name": "Div",
"props": {
"className": "flex-center"
},
"children": [
{
"type": "basic",
"name": "Span",
"props": {
"className": "text-heading"
},
"text": "$t:admin.settings.security.allow_internal_outbound_urls"
}
]
},
{
"type": "basic",
"name": "P",
"props": {
"className": "text-label-subtle"
},
"text": "$t:admin.settings.security.allow_internal_outbound_urls_desc"
},
{
"type": "basic",
"name": "Span",
"if": "{{_local.errors?.['security.allow_internal_outbound_urls']}}",
"props": {
"className": "form-error"
},
"text": "{{_local.errors?.['security.allow_internal_outbound_urls']?.[0] ?? ''}}"
}
]
},
{
"type": "composite",
"name": "Toggle",
"props": {
"name": "security.allow_internal_outbound_urls",
"size": "md",
"disabled": "{{_computed.isReadOnly}}"
}
}
]
},
{
"id": "toggle_login_attempt",
"type": "basic",