Skip to main content

openGauss EUVDEUVD-2026-40326

| CVE-2026-14178 MEDIUM
Use After Free (CWE-416)
2026-06-30 openGauss GHSA-v555-5g3c-vq2x
5.9
CVSS 3.1 · Vendor: openGauss
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Obtain valid database credentials
  2. Delivery
    Authenticate to openGauss 7.0.0-RC1 or RC2
  3. Exploit
    Submit to_timestamp() query with NLS parameter against an unindexed table
  4. Install
    Optimizer selects seqscan+sort plan
  5. C2
    SeqScan context freed, nls_fmt_str dangling
  6. Execute
    timestamp_out() dereferences freed pointer
  7. Impact
    Backend process crashes, availability impacted

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires an authenticated database session with SQL execution privileges on the openGauss instance - the description explicitly states this precondition ('具备数据库 SQL 执行权限'). The query must use to_timestamp() with a third NLS parameter (nlsparam) argument. Critically, the seqscan+sort execution path must be selected by the query optimizer, which typically occurs when querying a table without a suitable index on the timestamp column and when sorting is required; this is an AC:H condition since it depends on optimizer plan selection rather than being unconditionally triggerable. The vulnerability is limited to openGauss-server 7.0.0-RC1 and RC2 only. Note: the vendor-supplied CVSS vector encodes PR:N (no privileges required), which conflicts with the description's explicit privilege requirement - defenders should treat SQL execution privilege as a real prerequisite until the vendor clarifies the discrepancy.

Impact

The vendor-assigned CVSS 5.9 (AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H) contains a notable inconsistency: the description explicitly states exploitation requires database SQL execution privileges ('攻击者在具备数据库 SQL 执行权限的情况下'), yet the vector encodes PR:N (no privileges). This inflates the score; with PR:L the adjusted score would be approximately 5.3. AC:H is credible - the seqscan+sort execution path is a specific internal code path that requires a particular query plan to be selected by the optimizer, adding non-trivial trigger complexity. Impact is confined to availability (A:H, C:N, I:N), meaning a successful exploit crashes only the affected backend session process rather than the entire database cluster, which somewhat limits blast radius. No EPSS data was provided; given the niche deployment footprint of openGauss outside China, widespread opportunistic exploitation is unlikely. Neither KEV listing nor public POC has been identified, meaning real-world exploitation risk is currently theoretical. The vulnerability is relevant primarily to organizations running openGauss 7.0.0-RC1 or RC2 innovation releases in environments where untrusted or semi-trusted users hold SQL execution rights.

Exploit ScenarioDerived

An attacker holding a valid database account on an openGauss 7.0.0-RC1 or RC2 instance submits a SELECT statement that calls to_timestamp() with an NLS format parameter in a way that causes the query planner to choose a seqscan followed by a sort operation - for example, scanning a large table without an appropriate index while converting a timestamp column. When the SeqScan node completes and its memory context is freed, the subsequent timestamp_out() call dereferences the now-freed nls_fmt_str pointer, crashing the backend process and terminating the attacker's connection along with any in-flight transaction on that backend. Repeated invocations can sustain service disruption.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 30, 2026

Heap-use-after-free in openGauss 7.0.0-RC1 and RC2 allows a database user with SQL execution privileges to crash the backend process by crafting a to_timestamp() call with NLS parameters that triggers the seqscan+sort execution path. The nls_fmt_str pointer is stored in session context but allocated within SeqScan's expression memory context, which is freed upon scan completion; subsequent access by timestamp_out() via CheckNlsFormat() dereferences the dangling pointer. The practical impact is denial of service through backend process termination. No public exploit code or active exploitation (CISA KEV) has been identified at time of analysis.

RemediationAI

Vendor-released patch: openGauss-server 7.0.0-RC3. Because RC1 and RC2 are innovation releases, no backport patches will be issued - upgrade to RC3 or a later version is the only supported remediation path per the vendor advisory. The upstream fix is documented in gitcode.com/opengauss/openGauss-server/pull/8877. As a compensating control where immediate upgrade is not feasible, restrict SQL execution privileges to trusted users only and audit role grants to remove unnecessary execute permissions; this limits the attacker surface since exploitation requires an authenticated session. Additionally, consider placing the database behind a connection proxy or PgBouncer-style pool that enforces session limits, which can bound the impact of repeated crash attempts. Note that these controls reduce exposure but do not eliminate the vulnerability.

Affected VersionsENISA

openGauss-server-7.0.0-RC1 openGauss-server-7.0.0-RC1
openGauss-server-7.0.0-RC2 openGauss-server-7.0.0-RC2

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

openGauss is a relational database management system derived from PostgreSQL, primarily developed and deployed by Huawei. The vulnerability resides in the NLS (National Language Support) extension of the to_timestamp() function, specifically to_timestamp_with_fmt_nls(). This function saves a pointer to nls_fmt_str into a session-level structure (u_sess->parser_cxt.nls_fmt_str) without copying it out of the ephemeral memory context owned by the SeqScan executor node. PostgreSQL-derived databases use per-node expression contexts (ExprContexts) that are reset or freed when the node finishes processing; in the seqscan+sort execution path, this reset occurs before the result output phase completes. CWE-416 (Use After Free) applies directly: the dangling session pointer is then dereferenced inside CheckNlsFormat() called from timestamp_out(), producing a heap-use-after-free. Under AddressSanitizer or Valgrind Memcheck the process exits immediately; in production builds the behaviour is undefined and manifests as backend crash or data corruption. Affected CPEs are cpe:2.3:a:opengauss-server:opengauss-server-7.0.0-rc1 and cpe:2.3:a:opengauss-server:opengauss-server-7.0.0-rc2.

Know when Opengauss Server 7 0 0 Rc2 gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (openGauss) PRIMARY 5.9 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 5.3 MEDIUM

Description requires SQL execution privileges (PR:L not PR:N); AC:H retained because the specific seqscan+sort optimizer path must be triggered; no confidentiality or integrity impact.

3.1 AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:H/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (openGauss).

CVSS VectorVendor: openGauss

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

DescriptionCVE.org

openGauss 在处理带 NLS 参数的 to_timestamp 调用时,to_timestamp_with_fmt_nls() 会将 nls_fmt_str 保存到 u_sess->parser_cxt.nls_fmt_str。在 seqscan + sort 执行路径下,该字符串原本被分配在 SeqScan 的表达式上下文中;当 SeqScan 完成后,该内存上下文会被 reset,但后续结果输出阶段 timestamp_out() 仍会通过 CheckNlsFormat() 访问 u_sess->parser_cxt.nls_fmt_str,导致访问已释放内存。攻击者在具备数据库 SQL 执行权限的情况下,可构造特定 to_timestamp(..., ..., nlsparam) 查询触发 heap-use-after-free。在 ASan/Memcheck 环境下表现为数据库服务退出;在实际运行环境中可能造成后端进程异常退出,影响数据库服务可用性,形成拒绝服务风险。该问题在openGauss-server-7.0.0-RC1版本和openGauss-server-7.0.0-RC2版本存在,目前已在openGauss-server-7.0.0-RC3版本修复。由于 openGauss-server-7.0.0-RC1版本和openGauss-server-7.0.0-RC2均为创新版本,不会发布针对性补丁包,涉及版本升级至 openGauss-server-7.0.0-RC3或更新版本即可。

Threat Intelligence Overview

EPSS Score
0.4%
Top 73% exploitable
Prevalence
Low
niche Chinese-origin database, limited production footprint outside China
Data Quality
3 sources
Confidence: Low

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy