From eee891ed745bcc18a0f302d12169164348e1445a Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Sun, 2 Aug 2026 19:09:07 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F=20Sentinel:=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=20=EA=B2=80=EC=A6=9D=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=B0=9C=EC=83=9D=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8A=94=20?= =?UTF-8?q?=EC=A0=95=EC=88=98=20=EC=98=A4=EB=B2=84=ED=94=8C=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R/aFIPC.R 파일의 readline() 입력 검증 부분에서 사용할 수 있는 입력을 정확히 제한(1 또는 2)하도록 수정하여, 잘못된 형식의 큰 숫자가 입력될 경우 as.integer() 호출 시 발생할 수 있는 잠재적인 정수 오버플로우로 인한 프로세스 크래시를 방지했습니다. --- .jules/sentinel.md | 5 +++++ R/aFIPC.R | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.jules/sentinel.md b/.jules/sentinel.md index a8207a4..e26ee8a 100644 --- a/.jules/sentinel.md +++ b/.jules/sentinel.md @@ -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-02 - Fix integer overflow coercion vulnerability in interactive prompts +**Vulnerability:** Integer overflow coercion vulnerability where excessively large numeric strings pass the `^[0-9]+$` regex check but evaluate to `NA` in `as.integer()`, causing subsequent process crashes. +**Learning:** When validating interactive `readline()` numeric inputs, strictly match against exact expected values (e.g., `^[12]$`) rather than unbounded digit classes (e.g., `^[0-9]+$`). +**Prevention:** Always strictly match against exact expected values when validating inputs that evaluate to integers. diff --git a/R/aFIPC.R b/R/aFIPC.R index 6254651..918e19b 100644 --- a/R/aFIPC.R +++ b/R/aFIPC.R @@ -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)) } } @@ -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)) } } @@ -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)) } } From 0c125512f8d1de4868cf9640475f065380d75a64 Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Sun, 2 Aug 2026 19:14:52 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F=20Sentinel:=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=20=EA=B2=80=EC=A6=9D=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=B0=9C=EC=83=9D=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8A=94=20?= =?UTF-8?q?=EC=A0=95=EC=88=98=20=EC=98=A4=EB=B2=84=ED=94=8C=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R/aFIPC.R 파일의 readline() 입력 검증 부분에서 사용할 수 있는 입력을 정확히 제한(1 또는 2)하도록 수정하여, 잘못된 형식의 큰 숫자가 입력될 경우 as.integer() 호출 시 발생할 수 있는 잠재적인 정수 오버플로우로 인한 프로세스 크래시를 방지했습니다. From 0f1f1517f375b6178539370a2e9cc549c5550b74 Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Sun, 2 Aug 2026 19:40:00 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F=20Sentinel:=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=20=EA=B2=80=EC=A6=9D=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=B0=9C=EC=83=9D=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8A=94=20?= =?UTF-8?q?=EC=A0=95=EC=88=98=20=EC=98=A4=EB=B2=84=ED=94=8C=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R/aFIPC.R 파일의 readline() 입력 검증 부분에서 사용할 수 있는 입력을 정확히 제한(1 또는 2)하도록 수정하여, 잘못된 형식의 큰 숫자가 입력될 경우 as.integer() 호출 시 발생할 수 있는 잠재적인 정수 오버플로우로 인한 프로세스 크래시를 방지했습니다. 추가로 markdownlint CI 에러의 원인이었던 불필요한 공백을 .jules/sentinel.md에서 제거하여 빌드를 안정화시켰습니다.