/

CVE-2026-52833

Severity:

HIGH RISK

(8.0)

Code Injection (CWE-94) in Nuclio Java Function Builds

CVE-2026-52833

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary Code Execution During Builds

Severity:

HIGH RISK

(8.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Nuclio versions before 1.16.5 generate a Gradle build file from Java runtime configuration without escaping repository values. An attacker who can control the affected repository configuration may inject Groovy statements that execute during Gradle's configuration phase.

Affected context

The vulnerability occurs in Nuclio's Java runtime function-build workflow, where values from runtimeAttributes.repositories[] are inserted into a generated build.gradle file. Risk depends on whether an attacker can influence those configuration values and cause a function build to run in an environment with meaningful permissions or access to sensitive resources.

Exploit preconditions

  • Attack surface: Nuclio Java runtime function-build configuration
  • Required access: Ability to control or influence a repository value used during a function build
  • Trigger point: Generation and Gradle configuration of the build.gradle file
  • Why exploitation is possible: Repository values are rendered into a Groovy-based build file without context-appropriate escaping, allowing template data to alter the generated build logic

Why this happens

The underlying flaw is context-insensitive insertion of configuration data into executable build-script syntax. Nuclio uses Go's text/template package to render repository values into a Gradle file, but the {{ . }} action performs no escaping for the target Groovy context. A value containing syntax that closes the intended repositories block can therefore introduce additional Groovy statements. This behavior maps to CWE-94, Improper Control of Generation of Code, because externally influenced data changes generated code that is later executed by the build system.

Potential impact

  • An attacker may execute arbitrary Groovy or system-level commands in the build environment.
  • Build credentials, tokens, or source material could be exposed.
  • Function artifacts could be modified or replaced.
  • The compromise could spread through build pipelines or associated infrastructure.
  • Generated functions or dependencies could be affected by supply-chain tampering.

General mitigation guidance

Mitigation generally focuses on preventing configuration data from becoming

executable build syntax.

Common defensive patterns include:

  • Using structured Gradle-generation APIs or fixed templates with strongly constrained insertion points.
  • Applying context-aware escaping and allowlisting repository values before template rendering.
  • Separating user-controlled data from executable build logic wherever possible.
  • Running builds with least-privilege identities, isolated workers, restricted network access, and minimal filesystem permissions.
  • Keeping build credentials out of untrusted build environments and limiting secret exposure.
  • Treating generated build files as untrusted artifacts and validating them before execution.

How teams detect issues like this

Detection approaches can include:

  • Static analysis rules that identify unescaped template values inserted into Groovy, Gradle, shell, or other executable formats.
  • Code review checks for text/template usage where user-controlled data is emitted into source or build scripts.
  • Tests using delimiter and syntax-boundary characters to verify that generated files remain structurally constrained.
  • Policy enforcement requiring allowlisted repository formats and rejecting unexpected control characters.
  • Monitoring generated build files and build logs for unexpected task definitions, statements, or command execution.
  • Automated security review tools can help identify template-to-code injection patterns during development.

Sources

SourceLink
github.comgithub.com/nuclio/nuclio/commit/4c78040c759068e927f3ed7c6507543c15d4ae56
github.comgithub.com/nuclio/nuclio/pull/4149
github.comgithub.com/nuclio/nuclio/releases/tag/1.16.5
github.comgithub.com/nuclio/nuclio/security/advisories/GHSA-3v79-m2cg-89ww

Frequently asked

questions

Exploitability depends on whether an attacker can influence the repository configuration used by a Nuclio Java function build. A network-only attacker without that control may not be able to trigger the issue directly.

The relevant access is the ability to modify or supply values in runtimeAttributes.repositories[] and cause the affected build workflow to process them. The practical impact also depends on the permissions and connectivity available to the build environment.

Do not interpolate untrusted values directly into executable Gradle source. Use structured generation, strict allowlists, context-aware escaping, and validation before any generated build file is executed.

Treat generated scripts as code, maintain clear trust boundaries for build configuration, test template outputs with adversarial syntax, and isolate build workers with least privilege and restricted access.

Find out what's already
exploitable in your codebase.