GHSA-PRJ9-97MP-MWH2

Vulnerability from github – Published: 2026-06-24 17:43 – Updated: 2026-06-24 17:43
VLAI
Summary
OliveTin has Unvalidated `ot_`-prefixed Arguments that Bypass Input Filtering
Details

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:

  1. Not type-checked — the validation loop only iterates over the action's defined arguments, so ot_-prefixed arguments skip all type safety checks entirely.
  2. Set as environment variables — via buildEnv(), with completely unvalidated values, and passed to the executed command.
  3. Included in the template context — available as .Arguments.ot_* in template rendering.

Affected Code

Filter bypass — service/internal/executor/executor.go (lines 728–731):

func keepArgument(name string, definedNames map[string]struct{}) bool {
    _, ok := definedNames[name]
    return ok || strings.HasPrefix(name, "ot_")
}

System args only override two keys — service/internal/executor/executor.go (lines 742–745):

func injectSystemArgs(req *ExecutionRequest) {
    req.Arguments["ot_executionTrackingId"] = req.TrackingID
    req.Arguments["ot_username"] = req.AuthenticatedUser.Username
}

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):

func buildEnv(args map[string]string) []string {
    ret := append(os.Environ(), "OLIVETIN=1")
    for k, v := range args {
        varName := fmt.Sprintf("%v", strings.TrimSpace(strings.ToUpper(k)))
        if varName == "" { continue }
        ret = append(ret, fmt.Sprintf("%v=%v", varName, v))
    }
    return ret
}

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:

{
  "bindingId": "<any-action-id>",
  "arguments": [
    { "name": "ot_custom_var", "value": "arbitrary unvalidated content \n with newlines" },
    { "name": "ot_another",    "value": "$(whoami)" }
  ]
}

These arguments:

  • Pass through filterToDefinedArgumentsOnly (the ot_ prefix exempts them).
  • Are never type-checked (not in the action's argument definitions).
  • Become environment variables OT_CUSTOM_VAR and OT_ANOTHER in the executed command's environment.
  • Are available in the template rendering context as .Arguments.ot_custom_var and .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/template does 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:

var systemArgs = map[string]struct{}{
    "ot_executionTrackingId": {},
    "ot_username":            {},
}

func keepArgument(name string, definedNames map[string]struct{}) bool {
    _, isDefined := definedNames[name]
    _, isSystem := systemArgs[name]
    return isDefined || isSystem
}

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.


Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/OliveTin/OliveTin"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.0.0-20260531214440-ebffd9f040f7"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-53541"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-20"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-06-24T17:43:50Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "### Description\n\nThe `filterToDefinedArgumentsOnly` function in the executor is intended to discard any arguments not explicitly defined in the action\u0027s 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.\n\nThese bypassed arguments are:\n\n1. **Not type-checked** \u2014 the validation loop only iterates over the action\u0027s defined arguments, so `ot_`-prefixed arguments skip all type safety checks entirely.\n2. **Set as environment variables** \u2014 via `buildEnv()`, with completely unvalidated values, and passed to the executed command.\n3. **Included in the template context** \u2014 available as `.Arguments.ot_*` in template rendering.\n\n### Affected Code\n\n**Filter bypass \u2014 `service/internal/executor/executor.go` (lines 728\u2013731):**\n\n```go\nfunc keepArgument(name string, definedNames map[string]struct{}) bool {\n    _, ok := definedNames[name]\n    return ok || strings.HasPrefix(name, \"ot_\")\n}\n```\n\n**System args only override two keys \u2014 `service/internal/executor/executor.go` (lines 742\u2013745):**\n\n```go\nfunc injectSystemArgs(req *ExecutionRequest) {\n    req.Arguments[\"ot_executionTrackingId\"] = req.TrackingID\n    req.Arguments[\"ot_username\"] = req.AuthenticatedUser.Username\n}\n```\n\nAny other `ot_`-prefixed argument (e.g., `ot_malicious`) survives both functions.\n\n**Unvalidated values become environment variables \u2014 `service/internal/executor/executor.go` (lines 867\u2013882):**\n\n```go\nfunc buildEnv(args map[string]string) []string {\n    ret := append(os.Environ(), \"OLIVETIN=1\")\n    for k, v := range args {\n        varName := fmt.Sprintf(\"%v\", strings.TrimSpace(strings.ToUpper(k)))\n        if varName == \"\" { continue }\n        ret = append(ret, fmt.Sprintf(\"%v=%v\", varName, v))\n    }\n    return ret\n}\n```\n\nThe value `v` is never validated. It can contain newlines, shell metacharacters, null bytes, or any arbitrary data.\n\n### Proof of Concept\n\nAn attacker sends a `StartAction` request with extra `ot_`-prefixed arguments:\n\n```json\n{\n  \"bindingId\": \"\u003cany-action-id\u003e\",\n  \"arguments\": [\n    { \"name\": \"ot_custom_var\", \"value\": \"arbitrary unvalidated content \\n with newlines\" },\n    { \"name\": \"ot_another\",    \"value\": \"$(whoami)\" }\n  ]\n}\n```\n\nThese arguments:\n\n- Pass through `filterToDefinedArgumentsOnly` (the `ot_` prefix exempts them).\n- Are never type-checked (not in the action\u0027s argument definitions).\n- Become environment variables `OT_CUSTOM_VAR` and `OT_ANOTHER` in the executed command\u0027s environment.\n- Are available in the template rendering context as `.Arguments.ot_custom_var` and `.Arguments.ot_another`.\n\n### Impact\n\n- **Environment variable pollution** \u2014 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.\n- **Potential for secondary exploitation** \u2014 if any executed script or command reads `OT_`-prefixed environment variables, the unvalidated content could cause unexpected behavior.\n- **Template context pollution** \u2014 although Go\u0027s `text/template` does 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.\n\n### Suggested Fix\n\nRemove the `ot_` prefix exception from `keepArgument`, or restrict it to only the two known system arguments:\n\n```go\nvar systemArgs = map[string]struct{}{\n    \"ot_executionTrackingId\": {},\n    \"ot_username\":            {},\n}\n\nfunc keepArgument(name string, definedNames map[string]struct{}) bool {\n    _, isDefined := definedNames[name]\n    _, isSystem := systemArgs[name]\n    return isDefined || isSystem\n}\n```\n\n---\n\n## Discovery Methodology\n\nBoth vulnerabilities were identified through manual source code review of the OliveTin repository, focusing on:\n\n- Input validation boundaries (API request fields flowing into file system operations and execution contexts)\n- Argument filtering and type-checking logic in the executor\n- File path construction in the log persistence feature\n\nNo automated scanners or fuzzing tools were used. The review was conducted against the current `main` branch source code.\n\n---",
  "id": "GHSA-prj9-97mp-mwh2",
  "modified": "2026-06-24T17:43:50Z",
  "published": "2026-06-24T17:43:50Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/OliveTin/OliveTin/security/advisories/GHSA-prj9-97mp-mwh2"
    },
    {
      "type": "WEB",
      "url": "https://github.com/OliveTin/OliveTin/commit/ebffd9f040f791208aee1db2e5a8aecd1e3e603d"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/OliveTin/OliveTin"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "OliveTin has Unvalidated `ot_`-prefixed Arguments that Bypass Input Filtering"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…