fix(input): bound interactive menu choices before coercion - #330
fix(input): bound interactive menu choices before coercion#330seonghobae wants to merge 3 commits into
Conversation
기존 코드에서는 '1' 또는 '2'만 기대하는 프롬프트 입력 검증에 `^[0-9]+$`라는 느슨한 정규 표현식을 사용했습니다. 이는 32비트 정수 한계를 초과하는 입력이 들어올 경우, R의 `as.integer()` 함수에 의해 `NA`로 강제 변환되어 이후 로직의 오작동을 유발할 수 있습니다. 이 취약점을 해결하기 위해 정규 표현식을 `^[12]$`로 엄격하게 수정하여, 입력이 정확히 '1' 또는 '2'인 경우에만 통과되도록 방어 로직을 강화했습니다. 관련된 Sentinel 저널 기록과 유효성 검증 단위 테스트도 추가했습니다.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reachedNext included review available in 7 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
문제
autoFIPC()의 세 개 대화형 1/2 선택 경로가^[0-9]+$를 통과한 임의 길이 숫자를as.integer()로 넘기고 있었습니다. 메뉴 계약상 허용값은 1과 2뿐이므로, 그 밖의 숫자를 받아들였다가NAcoercion이나 후속 분기 오류에 맡길 이유가 없습니다. 이는 입력 계약/가용성 결함입니다. 별도 exploitability 근거 없이 MEDIUM 보안 취약점이나 정수 오버플로 공격으로 과장하지 않습니다.현재 causal repair
^[12]$로 제한합니다.tests/testthat/test-readline-validation.R은 exportedautoFIPC()를 실제 호출합니다. 함수의 lexical environment에만interactive()와readline()대역을 주입해 production prompt 경계를 지나가며,3, 매우 긴 숫자,10이 세 번 거절된 뒤 bounded failure가 되는지와 정확한2가 한 번에 허용되어 다음 제품 분기까지 도달하는지를 검증합니다..jules/sentinel.md추가분은 protectedmaster의 canonical blob으로 복원했습니다.exact head / evidence
master@f87c2324f1686135e57d8730c1b0b9420874f3004b38d796e411e4e87c5bf8e9d0ea2f1c65a589fe후속 gate는 동일 exact head에서 실제 R CMD/testthat 실행이 위 production-path regressions를 통과하고, 적용되는 security/quality/review checks가 terminal-success인지를 확인하는 것입니다. predecessor 결과, self-approval, no-op retrigger, gate weakening은 사용하지 않습니다.