/

CVE-2026-62350

Severity:

HIGH RISK

(7.2)

Arbitrary Code Execution (CWE-94) via TDengine UDF Upload

CVE-2026-62350

Deferred

Vulnerability type

Category:

Arbitrary Code Execution

CWE:

CWE-94

Impact:

Server-side Arbitrary Code Execution

Severity:

HIGH RISK

(7.2)

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

TDengine allows users with UDF creation privileges to upload shared libraries and register them as user-defined functions.

Before version 3.4.1.15, a crafted library could be installed and invoked via queries, enabling arbitrary C code execution on the TDengine server when those functions are executed.

Affected context

This vulnerability appears in TDengine deployments where user-defined functions (UDFs) are supported and users are granted create-udf or equivalent privileges.

It becomes relevant in environments that allow uploading and registering custom shared libraries as UDFs without strong validation, sandboxing, or segregation of duties between application users and administrators.

Exploit preconditions

  • Attack surface: TDengine server exposed through its database interface supporting UDF creation and invocation.
  • Required access: Ability to authenticate as a user with the privilege to upload and create UDFs (e.g., "create udf" role).
  • Trigger point: Registration of a crafted shared library as a UDF (such as an eval-style function) and subsequent invocation through a database query.
  • Why exploitation is possible: The server loads and executes code directly from user-supplied shared libraries without adequate constraints, allowing arbitrary C code within those libraries to run with the server's process privileges.

Why this happens

The root cause aligns with CWE-94: Improper Control of Generation of Code ('Code Injection').

TDengine's UDF mechanism trusts uploaded shared libraries and treats them as executable extensions of the database engine.

Without strict validation, sandboxing, or separation between user-controlled artifacts and server runtime code, attackers with UDF creation rights can generate and deploy arbitrary native code that the database will load and execute during query processing.

Potential impact

  • An attacker may execute arbitrary native C code in the context of the TDengine server process.
  • An attacker could read, modify, or delete data managed by the database engine.
  • An attacker may pivot from the database to the underlying host, accessing local files or services.
  • An attacker could disrupt availability through crashes, resource exhaustion, or logic tampering.
  • An attacker may implant persistent backdoors or surveillance logic within the server environment.

General mitigation guidance

Effective mitigation focuses on tightening control around UDF capabilities and treating server-side code execution as a high-trust operation.

Common patterns include:

  • Restricting or removing UDF creation privileges from non-administrative accounts; assign them only to tightly controlled service or admin roles.
  • Introducing rigorous approval workflows for new UDFs, including security review and testing before deployment.
  • Applying sandboxing or isolation techniques for UDF execution so that uploaded code runs with reduced privileges and limited access to system resources.
  • Enforcing least-privilege on the TDengine process and its host environment, reducing the impact of any executed code.
  • Maintaining strong governance over where shared libraries are stored and how they are loaded, avoiding direct reliance on user-controlled paths.

How teams detect issues like this

Organizations can detect and manage this class of risk through multiple layers:

  • Static analysis or manual review of UDF source code and build artifacts before they are approved for deployment.
  • Auditing configuration and role assignments to identify accounts with UDF creation privileges and verifying that these match policy.
  • Monitoring database logs for unusual UDF creation, modification, and invocation patterns, particularly libraries that appear outside standard deployment pipelines.
  • Implementing change-control policies that require peer review and security checks for any new shared libraries loaded by the database.
  • Leveraging automated code review tools where applicable to scan UDF implementations for unsafe operations and sensitive resource access.

Sources

SourceLink
github.comgithub.com/taosdata/TDengine/security/advisories/GHSA-f7wh-p233-87xv

Frequently asked

questions

Exploitation is limited to contexts where an attacker can authenticate with UDF creation privileges. It is not a generic remote, unauthenticated issue, but within such roles it can be highly impactful.

The attacker must have the ability to upload and register user-defined functions, typically via a role or account granted "create udf" or similar high-privilege permissions on the TDengine instance.

The safest approach is to strictly limit who can create UDFs, introduce validation and review of any UDF code, and, where possible, isolate UDF execution so that it does not run with full server privileges or unrestricted access to host resources.

Treat all extension mechanisms—UDFs, plugins, shared libraries—as high-trust pathways. Enforce least-privilege access, require code review and security validation for all new extensions, and design runtime environments so that uploaded code is sandboxed, monitored, and constrained by policy.

Find out what's already
exploitable in your codebase.