Skip to content

fix(input): bound interactive menu choices before coercion - #330

Draft
seonghobae wants to merge 3 commits into
masterfrom
sentinel/fix-integer-overflow-readline-17505914442145172116
Draft

fix(input): bound interactive menu choices before coercion#330
seonghobae wants to merge 3 commits into
masterfrom
sentinel/fix-integer-overflow-readline-17505914442145172116

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

문제

autoFIPC()의 세 개 대화형 1/2 선택 경로가 ^[0-9]+$를 통과한 임의 길이 숫자를 as.integer()로 넘기고 있었습니다. 메뉴 계약상 허용값은 1과 2뿐이므로, 그 밖의 숫자를 받아들였다가 NA coercion이나 후속 분기 오류에 맡길 이유가 없습니다. 이는 입력 계약/가용성 결함입니다. 별도 exploitability 근거 없이 MEDIUM 보안 취약점이나 정수 오버플로 공격으로 과장하지 않습니다.

현재 causal repair

  • common-item 확인, old-form BILOG prior, new-form BILOG prior의 대화형 입력을 모두 정확한 ^[12]$로 제한합니다.
  • 기존 Jules 생성 테스트가 production을 호출하지 않고 동일 정규식 자체만 재검사하던 문제를 normal descendant에서 제거했습니다.
  • tests/testthat/test-readline-validation.R은 exported autoFIPC()를 실제 호출합니다. 함수의 lexical environment에만 interactive()readline() 대역을 주입해 production prompt 경계를 지나가며, 3, 매우 긴 숫자, 10이 세 번 거절된 뒤 bounded failure가 되는지와 정확한 2가 한 번에 허용되어 다음 제품 분기까지 도달하는지를 검증합니다.
  • 이번 국소 메뉴 판단을 repository-wide 보안 교리로 일반화하던 .jules/sentinel.md 추가분은 protected master의 canonical blob으로 복원했습니다.

exact head / evidence

  • protected base: master@f87c2324f1686135e57d8730c1b0b9420874f300
  • exact head: 4b38d796e411e4e87c5bf8e9d0ea2f1c65a589fe
  • Draft / mechanically mergeable
  • exact-head R CMD check, Code Quality, Security Audit, Security Scan, CodeQL PR, SAST Semgrep가 새 head에서 queued이므로 GREEN이나 merge-ready를 주장하지 않습니다.

후속 gate는 동일 exact head에서 실제 R CMD/testthat 실행이 위 production-path regressions를 통과하고, 적용되는 security/quality/review checks가 terminal-success인지를 확인하는 것입니다. predecessor 결과, self-approval, no-op retrigger, gate weakening은 사용하지 않습니다.

기존 코드에서는 '1' 또는 '2'만 기대하는 프롬프트 입력 검증에 `^[0-9]+$`라는 느슨한 정규 표현식을 사용했습니다.
이는 32비트 정수 한계를 초과하는 입력이 들어올 경우, R의 `as.integer()` 함수에 의해 `NA`로 강제 변환되어 이후 로직의 오작동을 유발할 수 있습니다.
이 취약점을 해결하기 위해 정규 표현식을 `^[12]$`로 엄격하게 수정하여, 입력이 정확히 '1' 또는 '2'인 경우에만 통과되도록 방어 로직을 강화했습니다. 관련된 Sentinel 저널 기록과 유효성 검증 단위 테스트도 추가했습니다.
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 5a82cd55-3947-40b3-9cf2-a0a037898009

📥 Commits

Reviewing files that changed from the base of the PR and between f87c232 and 4b38d79.

📒 Files selected for processing (3)
  • .jules/sentinel.md
  • R/aFIPC.R
  • tests/testthat/test-readline-validation.R

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant