Skip to content

security: bound interactive binary choices to 1 or 2 - #249

Open
seonghobae wants to merge 13 commits into
masterfrom
sentinel-integer-overflow-fix-15093993624234078536
Open

security: bound interactive binary choices to 1 or 2#249
seonghobae wants to merge 13 commits into
masterfrom
sentinel-integer-overflow-fix-15093993624234078536

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Problem

Three interactive readline() paths accepted any digit string with ^[0-9]+$ and then called as.integer(). Inputs outside R's integer range can become NA_integer_; the downstream condition then aborts instead of treating the input as invalid.

Change

  • Restrict common-item, old-form prior, and new-form prior confirmations to the documented 1 or 2 choices with ^[12]$.
  • Preserve the existing three-attempt limit and non-interactive fail-closed behavior.
  • Add pre-existing namespace bindings for interactive() and readline() so testthat can replace base functions inside the locked package namespace without changing normal function lookup.
  • Require testthat 3.2.0, where local_mocked_bindings() is stable.
  • Exercise all three real prompt paths, including oversized input and unsupported values, rather than testing the source text.
  • Keep a focused Sentinel journal entry describing the failure mode and prevention rule.

Scope

Only R/aFIPC.R, the deterministic test binding, test dependency floor, focused tests, and the Sentinel note are changed. Earlier unrelated .Rbuildignore, Bolt, and Palette churn was removed.

Merge contract

Merge only after the exact current head passes R CMD check, code quality, security scans, central coverage evidence, all review threads, and independent review. No passing result is claimed before those checks finish.

@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 Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1cf0c4ee-2699-4f62-b158-f3134c5c34ad

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel-integer-overflow-fix-15093993624234078536

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.

Copy link
Copy Markdown
Collaborator Author

현재 HEAD는 제목·본문과 달리 R/aFIPC.R 변경을 포함하지 않습니다. 첫 커밋에는 세 readline() 경로를 ^[12]$로 제한하는 실제 수정이 있었지만, 후속 lint/정리 커밋에서 해당 런타임 변경이 되돌아가고 .jules/* 재포맷과 .Rbuildignore 변경만 남았습니다. 병합하면 취약점이 해결되지 않으므로, 브랜치를 실제 보안 수정 커밋으로 되돌린 뒤 회귀 테스트를 추가하여 같은 HEAD에서 다시 검증합니다.

@seonghobae
seonghobae force-pushed the sentinel-integer-overflow-fix-15093993624234078536 branch from d288682 to 45d29dc Compare August 14, 2026 08:04
@seonghobae seonghobae changed the title 🛡️ Sentinel: [CRITICAL] 정수 오버플로우 DoS 취약점 수정 security: bound interactive binary choices to 1 or 2 Aug 14, 2026
@seonghobae
seonghobae enabled auto-merge (squash) August 14, 2026 08:05
@google-labs-jules

Copy link
Copy Markdown

현재 HEAD는 제목·본문과 달리 R/aFIPC.R 변경을 포함하지 않습니다. 첫 커밋에는 세 readline() 경로를 ^[12]$로 제한하는 실제 수정이 있었지만, 후속 lint/정리 커밋에서 해당 런타임 변경이 되돌아가고 .jules/* 재포맷과 .Rbuildignore 변경만 남았습니다. 병합하면 취약점이 해결되지 않으므로, 브랜치를 실제 보안 수정 커밋으로 되돌린 뒤 회귀 테스트를 추가하여 같은 HEAD에서 다시 검증합니다.

네, 지적하신 사항을 수정했습니다. PR 브랜치의 HEAD에서 R/aFIPC.Rreadline() 입력 검증을 ^[12]$로 제한하는 보안 수정 커밋을 복구하였습니다. 또한, 해당 변경 사항이 제대로 동작하고 향후 회귀(regression)를 방지하기 위해 test-sentinel-input-validation.R 테스트를 추가하고 로컬에서 성공적으로 검증했습니다.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the integer-menu landing vehicle for the ^[0-9]+$^[12]$ contract. Keep it; close #255 and #259 as duplicates.

The implementation is the one to keep: NULL namespace bindings in R/mock-bindings.R, testthat >= 3.2.0, and three prompt-path tests (common-item, old-form BILOG, new-form BILOG via a fitted mirt old-form model). Do not add mockery.

Exact-head check failed at Set up R package dependencies — the stringfish/RcppParallel oneTBB ABI skew, not these tests. That repair is #212 (d8100098, check already green). Rebase this branch onto #212 after it lands, then re-run R CMD check on the new head before merge.

No APPROVE on this head while check is red.

Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 7a847342fda92365c4c40b9d70dc1d7fb71b7328.

  • Head SHA: 7a847342fda92365c4c40b9d70dc1d7fb71b7328

  • Workflow run: 32043011759

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (4 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (4 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test-sentinel-input-validation.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-sentinel-input-validation.R"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: a9e9c716ff2a7b431085e2dca13610d9428a43bf
  • Workflow run: 32122448347
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head a9e9c716ff2a7b431085e2dca13610d9428a43bf.

  • Head SHA: a9e9c716ff2a7b431085e2dca13610d9428a43bf

  • Workflow run: 32122448347

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (4 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (4 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test-sentinel-input-validation.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-sentinel-input-validation.R"]
  R2 --> V2["targeted test run"]
Loading

@cursor
cursor Bot force-pushed the sentinel-integer-overflow-fix-15093993624234078536 branch from 7a84734 to a9e9c71 Compare August 17, 2026 17:41

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head a9e9c716ff2a7b431085e2dca13610d9428a43bf.

  • Head SHA: a9e9c716ff2a7b431085e2dca13610d9428a43bf

  • Workflow run: 32122448347

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (4 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (4 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test-sentinel-input-validation.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-sentinel-input-validation.R"]
  R2 --> V2["targeted test run"]
Loading

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