Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
**Vulnerability:** Unvalidated inputs passed to `if()` statements can cause process crashes (`condition has length > 1`) or unexpected coercion vulnerabilities.
**Learning:** In R, optional boolean parameters that default to `NULL` should be validated using explicit runtime type validation (e.g., `if (!is.null(flag) && (!is.logical(flag) || length(flag) != 1 || is.na(flag)))`).
**Prevention:** Always implement explicit runtime type validation for optional boolean parameters.

## 2024-08-24 - [μž…λ ₯ μœ νš¨μ„± 검사 κ°•ν™”: μ •μˆ˜ μ˜€λ²„ν”Œλ‘œμš° λ°©μ§€]
**Vulnerability:** readline() μˆ˜μΉ˜ν˜• μž…λ ₯값에 λŒ€ν•΄ λ‹¨μˆœ 숫자 ν—ˆμš© μ •κ·œν‘œν˜„μ‹(^[0-9]+$)을 μ‚¬μš©ν•˜μ—¬, μ§€λ‚˜μΉ˜κ²Œ 큰 μˆ«μžκ°€ μž…λ ₯될 경우 as.integer() λ³€ν™˜ μ‹œ NAκ°€ λ°˜ν™˜λ˜μ–΄ ν”„λ‘œμ„ΈμŠ€ ν¬λž˜μ‹œ λ“± 예기치 μ•Šμ€ 였λ₯˜κ°€ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.
**Learning:** μ‚¬μš©μž μž…λ ₯은 μ •ν™•νžˆ μ˜ˆμƒλ˜λŠ” κ°’(^[12]$)λ§Œμ„ μ—„κ²©ν•˜κ²Œ λ§€μΉ­ν•˜μ—¬ μ •μˆ˜ μ˜€λ²„ν”Œλ‘œμš° κ°•μ œ λ³€ν™˜(integer overflow coercion) 취약점을 μ˜ˆλ°©ν•΄μ•Ό 함을 λ°°μ› μŠ΅λ‹ˆλ‹€.
**Prevention:** μΈν„°λž™ν‹°λΈŒ μž…λ ₯(readline λ“±) 검증 μ‹œ λ¬΄ν•œμ • λ°˜λ³΅λ˜λŠ” 숫자 클래슀(^[0-9]+$)λ₯Ό ν”Όν•˜κ³ , 항상 μ •ν™•ν•˜κ²Œ μΌμΉ˜ν•˜λŠ” κ°’λ§Œ ν—ˆμš©ν•˜λŠ” μ •κ·œν‘œν˜„μ‹μ„ μ‚¬μš©ν•΄μ•Ό ν•©λ‹ˆλ‹€.
6 changes: 3 additions & 3 deletions R/aFIPC.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ autoFIPC <-
}
for (attempt in seq_len(3)) {
n <- readline(prompt = "Is it correct? (1: Yes 2: No) : ")
if (grepl("^[0-9]+$", n)) {
if (grepl("^[12]$", n)) {
return(as.integer(n))
}
}
Expand Down Expand Up @@ -171,7 +171,7 @@ autoFIPC <-
readline(
prompt = "Do you want to use default BILOG-MG priors for oldform Data? (1: Yes 2: No) : "
)
if (grepl("^[0-9]+$", n)) {
if (grepl("^[12]$", n)) {
return(as.integer(n))
}
}
Expand Down Expand Up @@ -390,7 +390,7 @@ autoFIPC <-
readline(
prompt = "Do you want to use default BILOG-MG priors for newform Data? (1: Yes 2: No) : "
)
if (grepl("^[0-9]+$", n)) {
if (grepl("^[12]$", n)) {
return(as.integer(n))
}
}
Expand Down
Loading