Skip to content

๐Ÿ›ก๏ธ Sentinel: [MEDIUM] Add input validation to exported functions to fail securely - #108

Closed
seonghobae wants to merge 6 commits into
masterfrom
sentinel/input-validation-2862550611212438708
Closed

๐Ÿ›ก๏ธ Sentinel: [MEDIUM] Add input validation to exported functions to fail securely#108
seonghobae wants to merge 6 commits into
masterfrom
sentinel/input-validation-2862550611212438708

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

๐Ÿšจ Severity: MEDIUM
๐Ÿ’ก Vulnerability: Missing strict input validation on the adj and nested arguments in vuongtest() and the conf.level argument in icci(). This allows unvalidated inputs to propagate into internal functions, which can cause unexpected raw errors, malformed outputs (like NaN confidence bounds), and stack trace leakage revealing internal execution context.
๐ŸŽฏ Impact: An attacker or user could exploit this to crash the application unexpectedly or glean information about the internal execution environment by observing deep stack traces.
๐Ÿ”ง Fix: Added strict type, length, missingness (is.na), and bounds checking for these user-facing arguments at the beginning of the exported functions. All validation failures are caught immediately and handled securely using stop(..., call. = FALSE) to ensure no internal context is leaked.
โœ… Verification: Ran sudo R CMD INSTALL . and testthat::test_dir('tests/testthat'). Tests pass cleanly. Manually verified that invalid inputs (e.g. adj=c('aic', 'bic') or conf.level=1.5) now fail immediately and securely.


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


Devin Review

Summary by CodeRabbit

  • ๋ฒ„๊ทธ ์ˆ˜์ •

    • ์‹ ๋ขฐ๊ตฌ๊ฐ„ ์ˆ˜์ค€(conf.level)์ด 0๊ณผ 1 ์‚ฌ์ด์˜ ๋‹จ์ผ ์ˆซ์ž์ธ์ง€ ๊ฒ€์ฆํ•ฉ๋‹ˆ๋‹ค.
    • nested ๋ฐ adj ์ž…๋ ฅ๊ฐ’์˜ ํ˜•์‹๊ณผ ํ—ˆ์šฉ ๋ฒ”์œ„๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
    • ์ž˜๋ชป๋œ ์ž…๋ ฅ์— ๋Œ€ํ•ด ๋‚ด๋ถ€ ์˜ค๋ฅ˜๋‚˜ ์Šคํƒ ํŠธ๋ ˆ์ด์Šค ๋Œ€์‹  ๋ช…ํ™•ํ•œ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
  • ๋ฌธ์„œ

    • ์‚ฌ์šฉ์ž ์ž…๋ ฅ ๊ฒ€์ฆ ๋ฐ ์•ˆ์ „ํ•œ ์˜ค๋ฅ˜ ์ฒ˜๋ฆฌ์— ๊ด€ํ•œ ๋ณด์•ˆ ์ง€์นจ์„ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

@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 28, 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: d8077159-cf2d-46a7-8465-4df4bfaea742

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 807e940 and 9b671ba.

๐Ÿ“’ Files selected for processing (3)
  • .jules/sentinel.md
  • R/icci.R
  • R/vuongtest.R

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


๐Ÿ“ Walkthrough

Walkthrough

icci()์™€ vuongtest()๊ฐ€ ์‹คํ–‰ ์ดˆ๊ธฐ์— ์ž…๋ ฅ ์ธ์ž๋ฅผ ๊ฒ€์ฆํ•œ๋‹ค. ์œ ํšจํ•˜์ง€ ์•Š์€ ๊ฐ’์ด๋ฉด ํ˜ธ์ถœ์ž ์ •๋ณด๋ฅผ ์ œ์™ธํ•œ ์˜ค๋ฅ˜๋ฅผ ๋ฐœ์ƒ์‹œํ‚จ๋‹ค. ๊ด€๋ จ ๋ณด์•ˆ ํ•™์Šต ๋‚ด์šฉ๋„ ๋ฌธ์„œ์— ์ถ”๊ฐ€๋˜์—ˆ๋‹ค.

Changes

์ž…๋ ฅ ์ธ์ž ๊ฒ€์ฆ

Layer / File(s) Summary
๊ณต๊ฐœ ํ•จ์ˆ˜ ์ž…๋ ฅ ๊ฒ€์ฆ ๋ฐ ์•ˆ์ „ํ•œ ์‹คํŒจ
R/icci.R, R/vuongtest.R, .jules/sentinel.md
icci()๋Š” conf.level์˜ ํ˜•์‹, ๊ธธ์ด, NA ์—ฌ๋ถ€ ๋ฐ ๋ฒ”์œ„๋ฅผ ๊ฒ€์ฆํ•œ๋‹ค. vuongtest()๋Š” nested์™€ adj์˜ ํ˜•์‹, ๊ธธ์ด, NA ์—ฌ๋ถ€ ๋ฐ ํ—ˆ์šฉ๊ฐ’์„ ๊ฒ€์ฆํ•œ๋‹ค. ์ž˜๋ชป๋œ ์ž…๋ ฅ์—๋Š” call. = FALSE๋ฅผ ์ ์šฉํ•œ ๋ช…์‹œ์  ์˜ค๋ฅ˜๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. ๊ด€๋ จ ๋ณด์•ˆ ํ•™์Šต ๋‚ด์šฉ์„ ๋ฌธ์„œํ™”ํ•œ๋‹ค.

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

Merge Risk: โšช Minimal ยท up to 9b671

The change adds localized validation so invalid arguments fail early without exposing internal call context; no actionable merge-blocking risk remains after normal checks and review.

๐Ÿšฅ 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 ์ œ๋ชฉ์€ ๋‚ด๋ณด๋‚ธ ํ•จ์ˆ˜์— ์ž…๋ ฅ ๊ฒ€์ฆ์„ ์ถ”๊ฐ€ํ•˜๊ณ  ์•ˆ์ „ํ•˜๊ฒŒ ์‹คํŒจํ•˜๋„๋ก ๋ณ€๊ฒฝํ•œ ์ฃผ์š” ๋‚ด์šฉ์„ ์ •ํ™•ํ•˜๊ฒŒ ์š”์•ฝํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ณ€๊ฒฝ์€ PR์˜ ๋ชฉ์  ๋ฐ ์‹ค์ œ ์ˆ˜์ • ๋‚ด์šฉ๊ณผ ์ผ์น˜ํ•ฉ๋‹ˆ๋‹ค.
Docstring Coverage โœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0โ€ฆ
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)

โœจ Finishing Touches
๐Ÿงช Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel/input-validation-2862550611212438708

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.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Devin Review

Comment thread R/vuongtest.R
Comment on lines +104 to +106
if (!is.character(adj) || length(adj) != 1 || is.na(adj) || !(adj %in% c("none", "aic", "bic"))) {
stop("'adj' must be a single string matching 'none', 'aic', or 'bic'", call. = FALSE)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

๐Ÿ“ Info: adj now errors on previously-tolerated inputs

The old code compared adj only against "aic"/"bic", so any other value silently acted as "none". The strict check now errors on such inputs, a behavior change for callers that passed unexpected adj values.

Devin Review

Was this helpful? React with ๐Ÿ‘ or ๐Ÿ‘Ž to provide feedback.

Copy link
Copy Markdown
Collaborator Author

Verified successor closure: canonical option-validation PR #126 now has exact head 5a4be4cc5e231dc14155b611b4396ec631d5083a. Normal two-parent commit 5a4be4cc... records this PR's exact head 9b671ba6452b44e65c141ff574626cc0f957b78e as an ancestor without rewriting history. Fresh comparison is ahead 19 / behind 0 from #108 to #126. #126 retains the early nested / adj / conf.level admission behavior and strengthens it with persistent zero-length/non-scalar/NA/NaN/infinite/wrong-type/boundary regressions plus fixed conditionCall()==NULL error-shape evidence. The only omitted #108 delta is branch-local .jules/sentinel.md, intentionally rejected because it is not protected repository authority. No check/review result is transferred. Closing only as verified complete valid-delta succession; #126 remains Draft and must acquire fresh exact-head gates/review.

@seonghobae seonghobae closed this Sep 7, 2026
@google-labs-jules

Copy link
Copy Markdown

Verified successor closure: canonical option-validation PR #126 now has exact head 5a4be4cc5e231dc14155b611b4396ec631d5083a. Normal two-parent commit 5a4be4cc... records this PR's exact head 9b671ba6452b44e65c141ff574626cc0f957b78e as an ancestor without rewriting history. Fresh comparison is ahead 19 / behind 0 from #108 to #126. #126 retains the early nested / adj / conf.level admission behavior and strengthens it with persistent zero-length/non-scalar/NA/NaN/infinite/wrong-type/boundary regressions plus fixed conditionCall()==NULL error-shape evidence. The only omitted #108 delta is branch-local .jules/sentinel.md, intentionally rejected because it is not protected repository authority. No check/review result is transferred. Closing only as verified complete valid-delta succession; #126 remains Draft and must acquire fresh exact-head gates/review.

Understood. Acknowledging that this work is now obsolete and stopping work on this task. The PR is closed as verified complete valid-delta succession in favor of PR #126.

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

Labels

enhancement priority: medium Normal-priority or P2 work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant