비밀값 가림과 문자열 자르기 결함 수정 (v1.21.1) - #55
Merged
Merged
Conversation
SanitizeOperationMessage가 비밀값 표식 배열에서 처음 만난 표식에서 자르고 break 했다. 배열이 token= 다음에 password= 순서라 "password=hunter2 token=abcdef"는 token= 위치에서 잘려 앞쪽 password 값이 그대로 남았다. 이제 모든 표식 중 가장 앞선 위치에서 자른다. 소문자 사본의 인덱스를 원본에 적용하던 구조도 없애고 OrdinalIgnoreCase 검색을 직접 쓴다. 이 함수는 운영 기록, Windows 알림, Discord /mineharbor errors 응답이 모두 지나간다. 길이 제한으로 문구를 자를 때 서로게이트 쌍이 반으로 갈라져 이모지가 깨져 보였다. TruncateWithEllipsis 공용 헬퍼를 추가해 운영 기록, Discord 응답과 채널 알림, 오류 목록, Java 런타임 오류 요약, 런처 업데이트 릴리스 노트에 적용했다. Windows 알림은 잘라낸 뒤 공백을 다시 다듬는 동작이 달라 같은 검사를 인라인으로 넣었다. bump-version.ps1이 ConvertTo-Json의 CRLF를 그대로 써서 LF 파일인 version.json이 버전을 올릴 때마다 통째로 바뀐 diff로 나왔다. LF로 정규화한다. decompiled/Launcher.decompiled.cs는 바이트 단위로 편집했고 줄바꿈 구성(CRLF 3550 / CR CR LF 3550 / bare LF 417)은 그대로다. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
코드 검토에서 찾은 결함 3건 수정.
1. [보안] 비밀값 가림이 앞선 비밀값을 남김
SanitizeOperationMessage가 비밀값 표식 배열에서 처음 만난 표식에서 자르고break했다. 배열 순서가token=→password=라서"password=hunter2 token=abcdef"는token=위치(17)에서 잘리고 앞의password=hunter2가 그대로 남았다. 이제 모든 표식 중 가장 앞선 위치에서 자른다.이 함수는 운영 기록, Windows 알림, Discord
/mineharbor errors응답이 모두 지나가는 지점이다.소문자 사본(
ToLowerInvariant)의 인덱스를 원본 문자열에 적용하던 구조도 제거하고IndexOf(..., OrdinalIgnoreCase)를 직접 쓴다. 부수적으로 대문자 표식(PASSWORD=)도 가려진다.2. [정확성] 길이 제한으로 자를 때 서로게이트 쌍이 갈라짐
이모지가 자르는 경계에 걸리면 반쪽만 남아 깨진 글자로 표시됐다.
TruncateWithEllipsis공용 헬퍼를 추가해 6곳에 적용: 운영 기록(1000자), Discord 응답·채널 알림·오류 목록(260자), Java 런타임 오류 요약(403자), 런처 업데이트 릴리스 노트(3001자).WindowsNotifications는 공백 재다듬기 동작이 달라 같은 검사를 인라인 적용.3. bump-version.ps1이 version.json을 통째로 다시 씀
ConvertTo-Json이 CRLF로 줄을 나누는데version.json은 LF다. 버전을 올릴 때마다 4줄 파일이 전체 변경 diff(5+/5-)로 나왔다. LF로 정규화해 diff가 2줄이 된다.Test plan
.\scripts\Prepare-BuildResources.ps1/.\build.ps1/.\test.ps1 -LauncherPath artifacts\MineHarbor.exeVERSION_CONSISTENCY_OK,PASSED=33,PORTABLE_VERSION_OK,PORTABLE_SMOKE_OK,MODERN_DIALOG_SCAN_OK,SECURITY_REGRESSION_SCAN_OK,BRIDGE_PROTOCOL_PASSED=10decompiled/Launcher.decompiled.cs바이트 단위 편집, 줄바꿈 구성(CRLF 3550 / CR CR LF 3550 / bare LF 417) 유지, diff 1줄실제 Discord 자격 증명, 사용자 서버 데이터, 공유기 설정과 UPnP 매핑은 사용하지 않았습니다.
🤖 Generated with Claude Code