Skip to content

🛡️ Sentinel: [MEDIUM] Fix error handling leaking call stacks via unvalidated inputs - #84

Open
seonghobae wants to merge 8 commits into
masterfrom
fix-input-validation-14175515133901881384
Open

🛡️ Sentinel: [MEDIUM] Fix error handling leaking call stacks via unvalidated inputs#84
seonghobae wants to merge 8 commits into
masterfrom
fix-input-validation-14175515133901881384

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

What

  • Reject zero-length, non-scalar, non-logical, and missing nested values before model dispatch.
  • Reject non-scalar, non-character, missing, and out-of-domain adj values with a package-owned message.
  • Reject zero-length, non-scalar, non-numeric, missing, non-finite, and out-of-range conf.level values.
  • Suppress internal call disclosure for every public validation failure with call. = FALSE.
  • Record the exact fail-closed boundary and its regression matrix in the security history.

Test-first evidence

  • RED: test-only head 727f62b7497b8b14f62a8e9049ca3a9baa4d4028, R-CMD-check run 31457987851, job 93675642332, produced 28 failures. Zero-length and missing values reached llcont(NULL) or raw R control-flow errors with populated calls.
  • GREEN: exact current head 19607c6087284ec787af47490650a4140650215a.
    • R-CMD-check run 31458868227: success.
    • Security Scan run 31458868239: success.
    • SAST Semgrep run 31458868205: success.
  • The current-head regression matrix covers empty, vector, missing, non-finite, wrong-type, boundary, and out-of-domain inputs while asserting fixed package-owned messages and null condition calls.

Review state

OpenCode's current-head CHANGES_REQUESTED is not a source-test regression. Central run 31462496395 failed in its network-isolated R coverage sandbox before executing the suite because target-package imports CompQuadForm, mvtnorm, lavaan (>= 0.6-6), and sandwich were unavailable. The same exact head passed the repository-owned R-CMD-check above. The central coverage contract remains authoritative and must be repaired or rerun by its owning .github writer; this PR remains active-PR evidence and is not merge-ready until current-head review and repository policy are satisfied.


Original task: Jules 14175515133901881384

Summary by CodeRabbit

  • 버그 수정

    • icci()의 신뢰수준 입력값이 단일 유한 숫자이며 0과 1 사이인지 검증합니다.
    • vuongtest()nested 입력값 타입과 결측 여부를 확인합니다.
    • adj 입력값이 허용된 옵션(none, aic, bic) 중 하나인지 검증합니다.
    • 잘못된 입력에 대해 호출 정보가 노출되지 않는 명확한 오류 메시지를 제공합니다.
  • 테스트

    • 빈 값, 다중 값, 결측값, 잘못된 타입과 범위 등 주요 입력 오류 사례를 추가로 검증합니다.

Adds input validation using `stop(..., call. = FALSE)` and `match.arg()`
at the top of `vuongtest()` and `icci()` to prevent users from passing
incorrect types (like arrays where scalars are expected) which would bypass
the module's secure error boundaries and leak internal call stacks and
R execution logic.
@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 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a067c908-4bc6-4cfb-b18b-019706d07605

📥 Commits

Reviewing files that changed from the base of the PR and between 2116b0d and 19607c6.

📒 Files selected for processing (4)
  • .jules/sentinel.md
  • R/icci.R
  • R/vuongtest.R
  • tests/testthat/test-input-validation.R

📝 Walkthrough

Walkthrough

vuongtest()icci()에 제어 인자 검증을 추가했다. 잘못된 입력은 호출 정보 없이 오류를 반환한다. 관련 입력 사례와 오류 동작을 testthat으로 검증하고 보안 변경 이력을 기록했다.

Changes

입력 검증

Layer / File(s) Summary
제어 인자 검증
R/icci.R, R/vuongtest.R
icci()conf.level의 단일 유한 숫자와 범위를 검증한다. vuongtest()nested의 논리형 조건과 adj의 허용 문자열을 검증한다.
검증 테스트 및 변경 이력
tests/testthat/test-input-validation.R, .jules/sentinel.md
잘못된 입력, 지정된 오류 메시지, 호출 정보 비노출을 테스트한다. 입력 검증 및 오류 경계를 보안 변경 이력에 기록한다.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 검증되지 않은 입력으로 인한 호출 스택 노출 방지라는 변경의 주요 목적을 정확히 요약합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-input-validation-14175515133901881384

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.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown

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 727f62b7497b8b14f62a8e9049ca3a9baa4d4028.

  • Head SHA: 727f62b7497b8b14f62a8e9049ca3a9baa4d4028

  • Workflow run: 31458096008

  • 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 (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test-input-validation.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-input-validation.R"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 11, 2026

Copy link
Copy Markdown

OpenCode Review Overview

  • Head SHA: 3d8848c97db6a2d132dbcb01923b401bbd6821f9
  • Workflow run: 31497350819
  • 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 3d8848c97db6a2d132dbcb01923b401bbd6821f9.

  • Head SHA: 3d8848c97db6a2d132dbcb01923b401bbd6821f9

  • Workflow run: 31497350819

  • 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 (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test-input-validation.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-input-validation.R"]
  R2 --> V2["targeted test run"]
Loading

seonghobae and others added 4 commits August 11, 2026 13:21
Adds input validation using stop(..., call. = FALSE) at the top of
vuongtest() and icci() to prevent users from passing incorrect types
(like arrays where scalars are expected, or NA where finite bounds
are expected) which would bypass the module's secure error boundaries
and leak internal call stacks and R execution logic.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown

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 19607c6087284ec787af47490650a4140650215a.

  • Head SHA: 19607c6087284ec787af47490650a4140650215a

  • Workflow run: 31462496395

  • 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 (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test-input-validation.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-input-validation.R"]
  R2 --> V2["targeted test run"]
Loading

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

seonghobae and others added 2 commits August 11, 2026 12:52
Adds input validation using stop(..., call. = FALSE) at the top of
vuongtest() and icci() to prevent users from passing incorrect types
(like arrays where scalars are expected, or NA where finite bounds
are expected) which would bypass the module's secure error boundaries
and leak internal call stacks and R execution logic.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown

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 3d8848c97db6a2d132dbcb01923b401bbd6821f9.

  • Head SHA: 3d8848c97db6a2d132dbcb01923b401bbd6821f9

  • Workflow run: 31497350819

  • 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 (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test-input-validation.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-input-validation.R"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent opencode-agent Bot added priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: maintenance Maintenance, build, dependency, or operational upkeep labels Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: maintenance Maintenance, build, dependency, or operational upkeep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant