Skip to content

🛡️ Sentinel: [MEDIUM] Fix missing input validation in exported functions - #117

Closed
seonghobae wants to merge 3 commits into
masterfrom
sentinel-input-validation-2887817721635511304
Closed

🛡️ Sentinel: [MEDIUM] Fix missing input validation in exported functions#117
seonghobae wants to merge 3 commits into
masterfrom
sentinel-input-validation-2887817721635511304

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

🚨 Severity: MEDIUM
💡 Vulnerability: Missing type, length, and bound validations on arguments passed to exported functions (vuongtest and icci).
🎯 Impact: Malformed inputs (like NA or vectors of length > 1) could bypass secure boundaries and trigger raw internal R errors (e.g., "missing value where TRUE/FALSE needed" inside if statements), leaking internal execution contexts and stack traces to end users.
🔧 Fix: Added strict type, length, is.na(), and bound validations for the nested, adj, and conf.level arguments at the beginning of the exported functions to fail securely with call. = FALSE.
✅ Verification: Verified locally that passing malformed inputs now gracefully throws a generalized error without leaking the stack trace. All tests pass successfully.


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


Devin Review

@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 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 1af59481-1085-4c27-b1e1-b1c9c43ee6cb

📥 Commits

Reviewing files that changed from the base of the PR and between 807e940 and 86cf29c.

📒 Files selected for processing (3)
  • .jules/sentinel.md
  • R/icci.R
  • R/vuongtest.R

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 2 potential issues.

Devin Review

Comment thread R/vuongtest.R
Comment on lines +101 to +105
if (!is.logical(nested) || length(nested) != 1 || is.na(nested)) {
stop("The 'nested' argument must be a single logical value (TRUE or FALSE).", call. = FALSE)
}
if (!is.character(adj) || length(adj) != 1 || is.na(adj) || !(adj %in% c("none", "aic", "bic"))) {
stop("The 'adj' argument must be a single character string: '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.

🔍 Validation paths lack regression tests

No tests cover malformed conf.level, nested, or adj values and their sanitized errors. Future changes can silently weaken these exported API boundaries.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread R/icci.R
Comment on lines +68 to +69
if (!is.numeric(conf.level) || length(conf.level) != 1 || is.na(conf.level) || conf.level <= 0 || conf.level >= 1) {
stop("The 'conf.level' argument must be a single numeric value strictly between 0 and 1.", 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.

🔍 Validation change missing from changelog

The exported functions now reject previously accepted inputs, but NEWS omits this user-visible change. Repository guidance requires recording it.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Collaborator Author

Fresh successor verification: PR #122 at exact head 4de1f17dd8e6f9b2c33ed6f6f84cfd262462316f carries the complete valid behavior of this PR and strengthens it. For vuongtest(), #122 rejects malformed scalar nested and invalid adj before check.obj() exactly as this lane requires, then additionally validates ll1/ll2, optional score callbacks, and vc1/vc2. For icci(), it preserves the same scalar numeric (0,1) conf.level boundary and additionally validates likelihood callbacks. It also adds tests/testthat/test_public_argument_validation.R, which exercises malformed arguments before model introspection and pins call. = FALSE; #117 had no executable regression file. The Sentinel note’s substantive rule—validate exported arguments at the public boundary and fail deliberately without leaking an internal call—is also present in #122. No distinct test, fixture, API behavior, or domain contract remains unique here. #122 stays open until its own exact-head R-CMD/security gates are terminal; closing this predecessor is verified semantic succession, not queue reduction.

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

Copy link
Copy Markdown

Fresh successor verification: PR #122 at exact head 4de1f17dd8e6f9b2c33ed6f6f84cfd262462316f carries the complete valid behavior of this PR and strengthens it. For vuongtest(), #122 rejects malformed scalar nested and invalid adj before check.obj() exactly as this lane requires, then additionally validates ll1/ll2, optional score callbacks, and vc1/vc2. For icci(), it preserves the same scalar numeric (0,1) conf.level boundary and additionally validates likelihood callbacks. It also adds tests/testthat/test_public_argument_validation.R, which exercises malformed arguments before model introspection and pins call. = FALSE; #117 had no executable regression file. The Sentinel note’s substantive rule—validate exported arguments at the public boundary and fail deliberately without leaking an internal call—is also present in #122. No distinct test, fixture, API behavior, or domain contract remains unique here. #122 stays open until its own exact-head R-CMD/security gates are terminal; closing this predecessor is verified semantic succession, not queue reduction.

Understood. Acknowledging that this work is now obsolete and superseded by PR #122, and stopping work on this task.

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: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant