OliveTin has Unvalidated `ot_`-prefixed Arguments that Bypass Input Filtering
위협 신호 · CVSS · EPSS · KEV
이론적 심각도 점수
예측 데이터 없음
실측 악용 기록 없음
계획된 패치 주기 내 조치(60일 이내)
CVSS 벡터 · 메트릭
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N상세 설명
Description
The filterToDefinedArgumentsOnly function in the executor is intended to discard any arguments not explicitly defined in the action's configuration. However, a special case allows any argument whose name starts with ot_ to bypass this filter. While two system arguments (ot_executionTrackingId and ot_username) are injected by OliveTin and overridden, all other ot_-prefixed arguments supplied by the user pass through unmodified.
These bypassed arguments are:
- Not type-checked — the validation loop only iterates over the action's defined arguments, so
ot_-prefixed arguments skip all type safety checks entirely. - Set as environment variables — via
buildEnv(), with completely unvalidated values, and passed to the executed command. - Included in the template context — available as
.Arguments.ot_*in template rendering.
Affected Code
Filter bypass — service/internal/executor/executor.go (lines 728–731):
1func keepArgument(name string, definedNames map[string]struct{}) bool { 2 _, ok := definedNames[name] 3 return ok || strings.HasPrefix(name, "ot_") 4}System args only override two keys — service/internal/executor/executor.go (lines 742–745):
1func injectSystemArgs(req *ExecutionRequest) { 2 req.Arguments["ot_executionTrackingId"] = req.TrackingID 3 req.Arguments["ot_username"] = req.AuthenticatedUser.Username 4}Any other ot_-prefixed argument (e.g., ot_malicious) survives both functions.
Unvalidated values become environment variables — service/internal/executor/executor.go (lines 867–882):
1func buildEnv(args map[string]string) []string { 2 ret := append(os.Environ(), "OLIVETIN=1") 3 for k, v := range args { 4 varName := fmt.Sprintf("%v", strings.TrimSpace(strings.ToUpper(k))) 5 if varName == "" { continue } 6 ret = append(ret, fmt.Sprintf("%v=%v", varName, v)) 7 } 8 return ret 9}The value v is never validated. It can contain newlines, shell metacharacters, null bytes, or any arbitrary data.
Proof of Concept
An attacker sends a StartAction request with extra ot_-prefixed arguments:
1{ 2 "bindingId": "<any-action-id>", 3 "arguments": [ 4 { "name": "ot_custom_var", "value": "arbitrary unvalidated content \n with newlines" }, 5 { "name": "ot_another", "value": "$(whoami)" } 6 ] 7}These arguments:
- Pass through
filterToDefinedArgumentsOnly(theot_prefix exempts them). - Are never type-checked (not in the action's argument definitions).
- Become environment variables
OT_CUSTOM_VARandOT_ANOTHERin the executed command's environment. - Are available in the template rendering context as
.Arguments.ot_custom_varand.Arguments.ot_another.
Impact
- Environment variable pollution — attacker can set arbitrary environment variables (with
OT_uppercased prefix) in the execution environment of any action they can trigger. Scripts or programs that read custom environment variables could be influenced. - Potential for secondary exploitation — if any executed script or command reads
OT_-prefixed environment variables, the unvalidated content could cause unexpected behavior. - Template context pollution — although Go's
text/templatedoes not recursively evaluate data values (mitigating direct template injection), the extra arguments are accessible in the template context and could interact unexpectedly with custom template logic.
Suggested Fix
Remove the ot_ prefix exception from keepArgument, or restrict it to only the two known system arguments:
1var systemArgs = map[string]struct{}{ 2 "ot_executionTrackingId": {}, 3 "ot_username": {}, 4} 5 6func keepArgument(name string, definedNames map[string]struct{}) bool { 7 _, isDefined := definedNames[name] 8 _, isSystem := systemArgs[name] 9 return isDefined || isSystem10}Discovery Methodology
Both vulnerabilities were identified through manual source code review of the OliveTin repository, focusing on:
- Input validation boundaries (API request fields flowing into file system operations and execution contexts)
- Argument filtering and type-checking logic in the executor
- File path construction in the log persistence feature
No automated scanners or fuzzing tools were used. The review was conducted against the current main branch source code.
AI 심층 분석
공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.