🔍 CVE-2025-68156

7.5
CVSS Score
HIGH
2025-12-16
2026-10-13 11:10
✅ 완료

🇰🇷 한글 설명

Go 언어용 표현식 엔진인 Expr의 1.17.7 미만 버전에서 flatten, min, max 등 일부 내장 함수가 재귀 호출 시 최대 깊이를 제한하지 않는 취약점이 발견되었습니다. 공격자가 순환 참조나 매우 깊게 중첩된 데이터를 입력할 경우 스택 오버플로가 발생하여 애플리케이션이 비정상 종료될 수 있습니다.

💡 쉬운 설명

프로그램이 데이터를 처리할 때 끝없이 반복되는 구조를 만나면 과부하가 걸려 프로그램이 갑자기 꺼지는 문제입니다. 악의적인 데이터를 보내 서비스가 멈추게 만드는 공격이 가능합니다.

🇺🇸 원문 (English)

Expr is an expression language and expression evaluation for Go. Prior to version 1.17.7, several builtin functions in Expr, including `flatten`, `min`, `max`, `mean`, and `median`, perform recursive traversal over user-provided data structures without enforcing a maximum recursion depth. If the evaluation environment contains deeply nested or cyclic data structures, these functions may recurse indefinitely until exceed the Go runtime stack limit. This results in a stack overflow panic, causing the host application to crash. While exploitability depends on whether an attacker can influence or inject cyclic or pathologically deep data into the evaluation environment, this behavior represents a denial-of-service (DoS) risk and affects overall library robustness. Instead of returning a recoverable evaluation error, the process may terminate unexpectedly. In affected versions, evaluation of expressions that invoke certain builtin functions on untrusted or insufficiently validated data structures can lead to a process-level crash due to stack exhaustion. This issue is most relevant in scenarios where Expr is used to evaluate expressions against externally supplied or dynamically constructed environments; cyclic references (directly or indirectly) can be introduced into arrays, maps, or structs; and there are no application-level safeguards preventing deeply nested input data. In typical use cases with controlled, acyclic data, the issue may not manifest. However, when present, the resulting panic can be used to reliably crash the application, constituting a denial of service. The issue has been fixed in the v1.17.7 versions of Expr. The patch introduces a maximum recursion depth limit for affected builtin functions. When this limit is exceeded, evaluation aborts gracefully and returns a descriptive error instead of panicking. Additionally, the maximum depth can be customized by users via `builtin.MaxDepth`, allowing applications with legitimate deep structures to raise the limit in a controlled manner. Users are strongly encouraged to upgrade to the patched release, which includes both the recursion guard and comprehensive test coverage to prevent regressions. For users who cannot immediately upgrade, some mitigations are recommended. Ensure that evaluation environments cannot contain cyclic references, validate or sanitize externally supplied data structures before passing them to Expr, and/or wrap expression evaluation with panic recovery to prevent a full process crash (as a last-resort defensive measure). These workarounds reduce risk but do not fully eliminate the issue without the patch.

📍 영향받는 시스템

Expr library versions prior to v1.17.7

⚔️ 공격 벡터

사용자가 입력한 순환 참조 또는 깊게 중첩된 데이터 구조를 Expr 엔진이 평가하도록 유도하여 스택 오버플로 유발

🛡️ 대응 방법

Expr 라이브러리를 v1.17.7 이상 버전으로 업데이트하거나, 입력 데이터의 순환 참조를 방지하고 panic recovery를 적용합니다.

🔧 검증 코드

출력된 결과에서 expr의 버전을 확인하여 v1.17.7 미만인지 체크합니다.

Shell / Script
go list -m all | grep expr

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H