-
Notifications
You must be signed in to change notification settings - Fork 0
π‘οΈ Sentinel: [CRITICAL] Fix integer overflow DoS vulnerability #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
seonghobae
wants to merge
2
commits into
master
from
sentinel/fix-integer-overflow-dos-8815352759408415946
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| library(testthat) | ||
|
|
||
| test_that("autoFIPC handles invalid readline inputs securely", { | ||
| # We test the actual aFIPC::autoFIPC function using mockery to stub readline | ||
| # We use mockery::stub on the internal functions that call readline | ||
|
|
||
| # Dummy input data | ||
| new_model <- data.frame(matrix(rnorm(20), nrow=10)) | ||
| old_model <- data.frame(matrix(rnorm(20), nrow=10)) | ||
|
|
||
| # Stub interactive to return TRUE so we enter the readline branch | ||
| mockery::stub(autoFIPC, 'interactive', TRUE) | ||
|
|
||
| # Mock readline to return a large number that caused the NA DoS previously | ||
| # We use forced failure to simulate the 3 failed attempts | ||
| mock_readline <- mockery::mock("1000000000000", "1000000000000", "1000000000000") | ||
| mockery::stub(autoFIPC, 'readline', mock_readline) | ||
|
|
||
| # When confirmCommonItems is NULL, it prompts. If it fails 3 times, it stops. | ||
| expect_error( | ||
| autoFIPC( | ||
| newformXData = new_model, | ||
| oldformYData = old_model, | ||
| newformCommonItemNames = "X1", | ||
| oldformCommonItemNames = "X1", | ||
| confirmCommonItems = NULL | ||
| ), | ||
| "Too many invalid common item confirmation attempts" | ||
| ) | ||
| }) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π Maintainability & Code Quality | π‘ Minor | β‘ Quick win
μΈ νμΈ κ²½λ‘ λͺ¨λμ νκ· ν μ€νΈλ₯Ό μΆκ°νμΈμ.
μ΄ ν μ€νΈλ
confirmCommonItems = NULLμΈ common-item νμΈ κ²½λ‘λ§ μ€νν©λλ€. λ°λΌμR/aFIPC.RLine 174μ oldform BILOG prior κ²½λ‘μ Line 393μ newform BILOG prior κ²½λ‘μμ μ κ·μμ΄ λ€μ μνλμ΄λ μ΄ ν μ€νΈλ μ€ν¨νμ§ μμ΅λλ€. κ° κ²½λ‘μ λν΄ μ ν¨ν μ ν μλ΅μ μ 곡ν λ€ μΈ λ²μ oversized μ λ ₯μ μ λ¬νκ³ , ν΄λΉ retry-limit μ€λ₯λ₯Ό κ²μ¦νμΈμ.As per coding guidelines, βAdd tests/fixtures first when behavior changes are required.β
π€ Prompt for AI Agents
Source: Coding guidelines