Skip to content

fix(interactive): accept only documented 1/2 menu choices - #337

Draft
seonghobae wants to merge 14 commits into
masterfrom
sentinel-fix-integer-overflow-1837065342719723849
Draft

fix(interactive): accept only documented 1/2 menu choices#337
seonghobae wants to merge 14 commits into
masterfrom
sentinel-fix-integer-overflow-1837065342719723849

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Current exact authority — 2026-09-06

  • protected base: master@f87c2324f1686135e57d8730c1b0b9420874f300
  • exact head: f68823c988433d0026b477211982bd3f9e2ab560
  • ancestry: ahead 14 / behind 0 / merge-base = protected base
  • lifecycle: Draft / source + deterministic regression present / exact-head hosted evidence pending
  • effective protected-base delta: DESCRIPTION, R/aFIPC.R, tests/testthat/test-interactive-choice-validation.R

Verified finding

Three interactive prompts document exactly two valid choices, 1 and 2, but the protected behavior accepted any decimal string matching ^[0-9]+$ before as.integer() and downstream branching. Values such as 3 therefore passed the input validator despite not being a documented menu choice. Very large decimal strings can also coerce to NA.

The earlier generated framing called this a MEDIUM integer-overflow/process-crash vulnerability. The repository evidence does not establish memory corruption, integer wrap, or a process-crash exploit. The supported finding is an interactive input-contract/reliability defect: values outside the documented choice domain must be rejected before coercion and control flow.

R Core documents that integer coercion can produce NA for values outside the representable range; this is coercion/validation evidence, not proof of an overflow exploit: https://stat.ethz.ch/CRAN/doc/manuals/r-patched/fullrefman.pdf.

Causal repair and regression

Each prompt now validates with ^[12]$ before as.integer(), preserving the existing three-attempt fail-closed behavior.

The regression is now named for the actual contract and is deterministic:

  • common-item confirmation rejects 0, 3, and 12;
  • old-form prior selection rejects whitespace-prefixed input, non-numeric input, and a 1000-digit decimal value;
  • new-form prior selection accepts the preceding documented 1 needed to reach that prompt, then rejects out-of-domain/non-numeric/oversized values;
  • the old-form fixture no longer uses unseeded sample() data.

The branch also repairs intervening unrelated drift without rewriting history: .Rbuildignore, .jules/sentinel.md, and test_dummy.R are restored to protected authority and the unrelated .markdownlint.json addition is removed. mockery remains in Suggests because the focused regression uses it.

Exact-head evidence

Fresh workflows for f68823c988433d0026b477211982bd3f9e2ab560 are newly materialized and remain non-terminal:

  • Code Quality 34008102814: queued
  • Security Audit 34008102876: queued
  • R CMD check 34008102882: queued
  • SAST Semgrep 34008102754: queued
  • Security Scan 34008102782: queued
  • CodeQL PR 34008102750: queued

Predecessor results do not transfer. Keep Draft until one unchanged exact head has terminal applicable checks, zero valid unresolved review findings, fresh protected-base compatibility, and the then-live independent-review requirement.

Do not restore repository-wide Sentinel doctrine, reclassify this as integer overflow without evidence, manufacture severity, weaken the three-attempt contract, reintroduce random fixtures, suppress scanners, self-approve, force-push, destructively rebase, or create source-neutral churn merely to trigger workflows.

🚨 Severity: MEDIUM
💡 Vulnerability: `readline()` 입력 검증 시 제한 없는 정규식(`^[0-9]+$`)을 사용하여 정수 오버플로우로 인한 크래시 가능성이 있었습니다.
🎯 Impact: 악의적 또는 실수로 큰 숫자를 입력할 경우 프로세스가 크래시될 수 있습니다.
🔧 Fix: 정규식을 `^[12]$`로 수정하여 허용되는 값만 입력받도록 개선했습니다.
✅ Verification: 테스트 스위트가 통과하고 유효하지 않은 입력에 대해 올바르게 실패하는지 확인했습니다.
@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 5, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@seonghobae
seonghobae marked this pull request as draft September 5, 2026 20:10
@seonghobae seonghobae changed the title 🛡️ Sentinel: [MEDIUM] 대화형 입력 검증 시 정수 오버플로우 취약점 수정 fix(interactive): accept only documented 1/2 menu choices Sep 5, 2026
seonghobae and others added 9 commits September 5, 2026 21:49
🚨 Severity: MEDIUM
💡 Vulnerability: `readline()` 입력 검증 시 제한 없는 정규식(`^[0-9]+$`)을 사용하여 정수 오버플로우로 인한 크래시 가능성이 있었습니다.
🎯 Impact: 악의적 또는 실수로 큰 숫자를 입력할 경우 프로세스가 크래시될 수 있습니다.
🔧 Fix: 정규식을 `^[12]$`로 수정하여 허용되는 값만 입력받도록 개선했습니다.
✅ Verification: 테스트 스위트가 통과하고 유효하지 않은 입력에 대해 올바르게 실패하는지 확인했습니다. (mockery를 사용하여 테스트 구현)
🚨 Severity: MEDIUM
💡 Vulnerability: `readline()` 입력 검증 시 제한 없는 정규식(`^[0-9]+$`)을 사용하여 정수 오버플로우로 인한 크래시 가능성이 있었습니다.
🎯 Impact: 악의적 또는 실수로 큰 숫자를 입력할 경우 프로세스가 크래시될 수 있습니다.
🔧 Fix: 정규식을 `^[12]$`로 수정하여 허용되는 값만 입력받도록 개선했습니다.
✅ Verification: mockery를 사용하여 유효하지 않은 입력에 대해 올바르게 실패하는지 테스트를 추가하고 통과를 확인했습니다.
🚨 Severity: MEDIUM
💡 Vulnerability: `readline()` 입력 검증 시 제한 없는 정규식(`^[0-9]+$`)을 사용하여 정수 오버플로우로 인한 크래시 가능성이 있었습니다.
🎯 Impact: 악의적 또는 실수로 큰 숫자를 입력할 경우 프로세스가 크래시될 수 있습니다.
🔧 Fix: 정규식을 `^[12]$`로 수정하여 허용되는 값만 입력받도록 개선했습니다.
✅ Verification: 테스트 스위트가 통과함을 로컬에서 확인했습니다. (mockery 단위 테스트 개선)
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