Skip to main content
Vulnerability Database/CVE-2026-52833

CVE-2026-52833: Nuclio Java Runtime RCE Vulnerability

CVE-2026-52833 is a remote code execution flaw in Nuclio's Java runtime that lets attackers inject Groovy code through template rendering. This post explains its impact, affected versions, and mitigation steps.

Published:

CVE-2026-52833 Overview

CVE-2026-52833 is a code injection vulnerability [CWE-94] in Nuclio, a serverless framework for real-time events and data processing. The flaw affects Nuclio's Java runtime, which generates a build.gradle file during function builds using Go's text/template package. The template renders runtimeAttributes.repositories[] values with the {{ . }} action, which performs no escaping. An attacker with permission to configure Java function attributes can inject a closing brace to escape the repositories {} block and append arbitrary Groovy statements. Those statements execute unconditionally during the Gradle configuration phase. The issue is patched in Nuclio version 1.16.5.

Critical Impact

Attackers who can supply runtimeAttributes.repositories values gain arbitrary Groovy code execution inside the Nuclio build environment, compromising build hosts and downstream artifacts.

Affected Products

  • Nuclio serverless framework versions prior to 1.16.5
  • Nuclio Java runtime function builds
  • Nuclio deployments exposing function configuration to untrusted or lower-privileged users

Discovery Timeline

  • 2026-09-02 - CVE-2026-52833 published to NVD
  • 2026-09-02 - Last updated in NVD database

Technical Details for CVE-2026-52833

Vulnerability Analysis

The Nuclio Java runtime builder assembles a build.gradle script from a Go text/template. Each entry in runtimeAttributes.repositories[] is rendered directly with {{ . }}, which emits the value verbatim without any Groovy or Gradle-aware escaping. Legitimate values look like mavenCentral() or google() and are placed inside a repositories { ... } block. An attacker can supply a value containing a } character followed by arbitrary Groovy code. The closing brace terminates the repositories block early, and the trailing Groovy is treated as top-level script content that Gradle evaluates during its configuration phase. This grants full command execution on the build host under the identity that runs the Nuclio builder. Because Gradle configures scripts before any task runs, exploitation does not require the built function to be invoked.

Root Cause

The root cause is unsanitized template interpolation of user-controllable configuration data into a code artifact. Go's text/template performs no context-aware escaping, and the Java runtime accepted any string in runtimeAttributes.repositories[]. No allow-list, character filter, or structural validation was applied before rendering the value into executable Groovy.

Attack Vector

Exploitation requires network access to the Nuclio control plane and privileges to submit or modify a Java function specification. The attacker crafts a runtimeAttributes.repositories entry that breaks out of the repositories {} block and appends Groovy statements such as process execution calls. When Nuclio builds the function, Gradle evaluates the injected code, achieving remote code execution in the build environment.

go
// Patch: pkg/processor/build/runtime/java/types.go
import (
	"fmt"
	"regexp"
	"strings"

	"github.com/mitchellh/mapstructure"
	"github.com/nuclio/errors"
	"sigs.k8s.io/yaml"
)

// repositoryPattern matches a single no-argument Gradle repository declaration
// of the form "name()" (e.g. "mavenCentral()"). Repository values are rendered
// verbatim into the generated build.gradle, so the value must not be able to
// express arbitrary Groovy that Gradle would execute during its configuration
// phase (GHSA-3v79-m2cg-89ww). Permitting only a bare "name()" call - no ".",
// no arguments, no string-delimiter characters - means no method chain, command
// string or block break-out can be formed, while every documented repository
// shortcut (mavenCentral(), jcenter(), google(), mavenLocal(),
// gradlePluginPortal()) is accepted. Surrounding whitespace is trimmed before
// matching.
var repositoryPattern = regexp.MustCompile(`^[A-Za-z][A-Za-z0-9_]*\(\)$`)

Source: GitHub Commit 4c78040

The fix introduces a strict regular expression that only allows bare name() repository declarations, rejecting dots, arguments, quotes, and braces that would enable a Groovy break-out.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-52833

Indicators of Compromise

  • Nuclio Java function specifications containing } characters or non-alphanumeric content inside runtimeAttributes.repositories[] entries
  • Generated build.gradle files with content outside the repositories { ... } block that was not authored by developers
  • Unexpected child processes spawned by the Gradle build (sh, bash, curl, wget, python) during Nuclio Java function builds
  • Outbound network connections from Nuclio build pods or hosts to unknown destinations during function build phases

Detection Strategies

  • Audit Nuclio function definitions and reject or flag any repositories[] entry that does not match the pattern ^[A-Za-z][A-Za-z0-9_]*\(\)$
  • Inspect archived build.gradle artifacts for Groovy statements appearing outside expected blocks
  • Correlate Nuclio build events with process execution telemetry on the builder host to detect anomalous command execution during Gradle configuration

Monitoring Recommendations

  • Log all function create and update API calls to the Nuclio dashboard and controller, including full runtimeAttributes payloads
  • Alert on Gradle processes that spawn shell interpreters or network utilities during Nuclio Java builds
  • Track version metadata across Nuclio installations to identify hosts still running versions prior to 1.16.5

How to Mitigate CVE-2026-52833

Immediate Actions Required

  • Upgrade Nuclio to version 1.16.5 or later across all controllers and builder components
  • Review existing Java function specifications and remove any runtimeAttributes.repositories[] value that is not a plain name() shortcut such as mavenCentral()
  • Restrict permission to create or modify Nuclio function specifications to trusted operators only
  • Rotate credentials and tokens accessible from the Nuclio build environment if injection is suspected

Patch Information

The vulnerability is fixed in Nuclio 1.16.5. The patch, delivered in Pull Request #4149 and commit 4c78040, adds an allow-list regular expression that validates each repository entry before it is rendered into build.gradle. See the GitHub Security Advisory GHSA-3v79-m2cg-89ww for the full advisory.

Workarounds

  • If upgrading is not immediately possible, enforce input validation at an API gateway or admission controller to reject repositories[] values that contain characters other than letters, digits, underscore, and the trailing ()
  • Isolate Nuclio builder workloads on dedicated hosts with minimal network egress and no access to production secrets
  • Disable the Java runtime for untrusted tenants until the platform is patched
bash
# Verify Nuclio version and enumerate Java functions with suspicious repository values
nuctl version
nuctl get function --output yaml \
  | grep -E 'repositories:|- .*[^A-Za-z0-9_()]' 

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.