Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix interactive readline DoS vulnerability#137

Open
seonghobae wants to merge 4 commits into
masterfrom
sentinel-fix-readline-validation-11118553040042817305
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix interactive readline DoS vulnerability#137
seonghobae wants to merge 4 commits into
masterfrom
sentinel-fix-readline-validation-11118553040042817305

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: aFIPC.R 파일 λ‚΄μ—μ„œ μ‚¬μš©μž μž…λ ₯을 λ°›λŠ” λŒ€ν™”ν˜•(interactive) ν•¨μˆ˜(readline)에 적용된 μž…λ ₯ μœ νš¨μ„± 검사 μ •κ·œμ‹μ΄ ^[0-9]+$둜 λŠμŠ¨ν•˜κ²Œ μž‘μ„±λ˜μ–΄ μžˆμ—ˆμŠ΅λ‹ˆλ‹€. 이λ₯Ό 톡해 μ•…μ˜μ μœΌλ‘œ 큰 숫자 (예: "99999999999999999999")κ°€ μž…λ ₯될 경우, as.integer() λ³€ν™˜ μ‹œ NAκ°€ λ°˜ν™˜λ˜μ–΄ λΆ„κΈ°λ¬Έ(if)이 κΉ¨μ§€κ³  ν”„λ‘œμ„ΈμŠ€κ°€ ν¬λž˜μ‹œ(condition has length > 1)λ˜λŠ” DoS(μ„œλΉ„μŠ€ κ±°λΆ€) 취약점이 λ°œμƒν•  수 μžˆμ—ˆμŠ΅λ‹ˆλ‹€.
🎯 Impact: μžλ™ν™”λœ μ‹œμŠ€ν…œμ΄κ±°λ‚˜ νŠΉμ • μ•…μ˜μ  μ‚¬μš©μž ν™˜κ²½μ—μ„œ 큰 값이 μž…λ ₯될 경우 λ¬΄ν•œ 루프 λ˜λŠ” ν¬λž˜μ‹œλ₯Ό μœ λ°œν•˜μ—¬ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ 정상적인 μž‘λ™μ„ λ§ˆλΉ„μ‹œν‚¬ 수 μžˆμŠ΅λ‹ˆλ‹€.
πŸ”§ Fix: checkCorrect(), checkoldformBILOGprior(), checknewformBILOGprior() 3κ³³μ—μ„œ μ‚¬μš©ν•˜λŠ” μ •κ·œμ‹μ„ ^[12]$둜 μ—„κ²©ν•˜κ²Œ μˆ˜μ •ν•˜μ—¬ 였직 '1' λ˜λŠ” '2'만 μž…λ ₯ κ°€λŠ₯ν•˜λ„λ‘ μ œν•œν–ˆμŠ΅λ‹ˆλ‹€.
βœ… Verification: μˆ˜μ • ν›„ mockery 라이브러리λ₯Ό μ΄μš©ν•˜μ—¬ readline() ν˜ΈμΆœμ— "99999999999999999999" 등을 μ‚½μž…ν–ˆμ„ λ•Œ μ˜λ„λœ λŒ€λ‘œ μž¬μ‹œλ„ 및 κ±°λΆ€κ°€ λ°œμƒν•˜λŠ”μ§€ κ²€μ¦ν•˜λŠ” ν…ŒμŠ€νŠΈ μ½”λ“œ(test-sentinel-validation.R)λ₯Ό μΆ”κ°€ν–ˆμœΌλ©°, 전체 ν…ŒμŠ€νŠΈ(58건)κ°€ μ„±κ³΅μ μœΌλ‘œ 톡과함을 ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€. (Rscript -e 'devtools::test()')


PR created automatically by Jules for task 11118553040042817305 started by @seonghobae

In interactive sessions, `readline()` historically relied on a weak regex `^[0-9]+$` to validate input. This permitted arbitrarily large strings, which coerced to `NA_integer_` and broke conditionals, resulting in crashes.
The regex was strictly bounded to `^[12]$` ensuring only correct menu selections are permitted. Included `mockery` coverage for testing.
@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.

@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 dc8cee52529b187e24d0d040e37055c22a1bbb11.

  • Head SHA: dc8cee52529b187e24d0d040e37055c22a1bbb11

  • Workflow run: 29348137515

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

@opencode-agent

opencode-agent Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 7666e6484e993f1276e928ccee7aa334eb603513
  • Workflow run: 29351801405
  • 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 7666e6484e993f1276e928ccee7aa334eb603513.

  • Head SHA: 7666e6484e993f1276e928ccee7aa334eb603513

  • Workflow run: 29351801405

  • 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-sentinel-validation.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-sentinel-validation.R"]
  R2 --> V2["targeted test run"]
Loading

In interactive sessions, `readline()` historically relied on a weak regex `^[0-9]+$` to validate input. This permitted arbitrarily large strings, which coerced to `NA_integer_` and broke conditionals, resulting in crashes.
The regex was strictly bounded to `^[12]$` ensuring only correct menu selections are permitted. Included `mockery` coverage for testing. Added mockery to Suggests in DESCRIPTION to satisfy R CMD check constraints.

@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 fcb2e89dc58042930e7fd168ae8364878ea542da.

  • Head SHA: fcb2e89dc58042930e7fd168ae8364878ea542da

  • Workflow run: 29348849961

  • 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-sentinel-validation.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-sentinel-validation.R"]
  R2 --> V2["targeted test run"]
Loading

In interactive sessions, `readline()` historically relied on a weak regex `^[0-9]+$` to validate input. This permitted arbitrarily large strings, which coerced to `NA_integer_` and broke conditionals, resulting in crashes.
The regex was strictly bounded to `^[12]$` ensuring only correct menu selections are permitted. Included `mockery` coverage for testing. Added mockery to Suggests in DESCRIPTION to satisfy R CMD check constraints and also regenerated documentation with `devtools::document()`.

@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 c0b5298be5feb4f4c3bee1158c58196b53f8ff27.

  • Head SHA: c0b5298be5feb4f4c3bee1158c58196b53f8ff27

  • Workflow run: 29350278170

  • 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-sentinel-validation.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-sentinel-validation.R"]
  R2 --> V2["targeted test run"]
Loading

In interactive sessions, `readline()` historically relied on a weak regex `^[0-9]+$` to validate input. This permitted arbitrarily large strings, which coerced to `NA_integer_` and broke conditionals, resulting in crashes.
The regex was strictly bounded to `^[12]$` ensuring only correct menu selections are permitted. Included `mockery` coverage for testing. Added mockery to Suggests in DESCRIPTION to satisfy R CMD check constraints and also regenerated documentation with `devtools::document()`. Reverting an accidental `RoxygenNote` change to fix coverage-evidence failure.

@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 7666e6484e993f1276e928ccee7aa334eb603513.

  • Head SHA: 7666e6484e993f1276e928ccee7aa334eb603513

  • Workflow run: 29351801405

  • 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-sentinel-validation.R"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test-sentinel-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