# CVE-2026-65651: temporalio/sqlparser deeply nested unary expressions can cause a fatal stack overflow during AST traversal

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.7
- **CVSS:** 8.7 (v4.0, CNA) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: None; Privileges required: None; User interaction: None; Confidentiality impact: None; Integrity impact: None; Availability impact: High; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.67% (percentile 47, 2026-11-26)
- **CWE:** CWE-674
- **Published:** 2026-09-21T11:34:05.930Z
- **Modified:** 2026-09-22T19:40:05.870Z

## Who should check

- Anyone running Temporal Technologies, Inc. temporalio/sqlparser \>= 0.0.0-20141206041240-1aae9baceee8, \< 0.0.0-20260721183058-0466b6b405ac
- Anyone running Temporal Technologies, Inc. Temporal Server \>= 0.10.0, \<= 1.29.7; \>= 1.30.0, \< 1.30.7; \>= 1.31.0, \< 1.31.3

## Description

temporalio/sqlparser accepts SQL containing deeply nested unary expressions and can return a correspondingly deep abstract syntax tree without enforcing an applicable nesting limit. The library's String and Walk operations recursively traverse that tree. An application that parses attacker-controlled SQL and later formats or walks the returned tree can encounter a runtime-fatal Go stack overflow that terminates the process; Go panic recovery cannot contain this condition. Temporal Server passes caller-controlled query input through the affected parser in archival, visibility, and worker-query paths. In affected validation paths, the Server recursively formats an invalid expression while constructing an error. In a supported authenticated deployment, a caller with namespace read permission can terminate the receiving Frontend or Matching process. The dynamically confirmed ListWorkers route additionally requires at least one retained worker heartbeat. Repeated requests can sustain a denial of service. The issue affects availability only; no confidentiality or integrity impact was identified.

## Affected and fixed versions

- Temporal Technologies, Inc. temporalio/sqlparser: \>= 0.0.0-20141206041240-1aae9baceee8, \< 0.0.0-20260721183058-0466b6b405ac (cvelist)
- Temporal Technologies, Inc. Temporal Server: \>= 0.10.0, \<= 1.29.7; \>= 1.30.0, \< 1.30.7; \>= 1.31.0, \< 1.31.3 (cvelist)

## Mitigation

- Upgrade temporalio/sqlparser to 0.0.0-20260721183058-0466b6b405ac or later.
- Upgrade Temporal Server to 1.31.3 or later.
- Vendor workaround: Applications can impose a conservative query-size or nesting limit before parsing and avoid recursively formatting or walking parser-produced trees derived from untrusted input. Temporal Server 1.29 and 1.30 operators can disable ListWorkers when it is unused, disable unused archival reads, and restrict namespace read permission to trusted principals. Go panic recovery is not an effective mitigation for runtime-fatal stack overflow.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-65651. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-65651.md
Affected: Temporal Technologies, Inc. temporalio/sqlparser >= 0.0.0-20141206041240-1aae9baceee8, < 0.0.0-20260721183058-0466b6b405ac; Temporal Technologies, Inc. Temporal Server >= 0.10.0, <= 1.29.7; >= 1.30.0, < 1.30.7; >= 1.31.0, < 1.31.3
Fixed in: Temporal Technologies, Inc. temporalio/sqlparser 0.0.0-20260721183058-0466b6b405ac, Temporal Technologies, Inc. Temporal Server 1.30.7, Temporal Technologies, Inc. Temporal Server 1.31.3

Steps:
1. Search this machine and project for Temporal Technologies, Inc. temporalio/sqlparser, Temporal Technologies, Inc. Temporal Server: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-65651 being exploited?

There is no confirmed exploitation: CVE-2026-65651 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.67% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-65651?

High: CVSS 8.7 (v4.0, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2026-65651?

Temporal Technologies, Inc. temporalio/sqlparser \>= 0.0.0-20141206041240-1aae9baceee8, \< 0.0.0-20260721183058-0466b6b405ac; Temporal Technologies, Inc. Temporal Server \>= 0.10.0, \<= 1.29.7; \>= 1.30.0, \< 1.30.7; \>= 1.31.0, \< 1.31.3.

### Is there a fix for CVE-2026-65651?

Yes. Fixed in Temporal Technologies, Inc. temporalio/sqlparser 0.0.0-20260721183058-0466b6b405ac, Temporal Technologies, Inc. Temporal Server 1.30.7, Temporal Technologies, Inc. Temporal Server 1.31.3. Upgrade temporalio/sqlparser to 0.0.0-20260721183058-0466b6b405ac or later. Upgrade Temporal Server to 1.31.3 or later. Vendor workaround: Applications can impose a conservative query-size or nesting limit before parsing and avoid recursively formatting or walking parser-produced trees derived from untrusted input. Temporal Server 1.29 and 1.30 operators can disable ListWorkers when it is unused, disable unused archival reads, and restrict namespace read permission to trusted principals. Go panic recovery is not an effective mitigation for runtime-fatal stack overflow.

### How do I check if I'm affected by CVE-2026-65651?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://github.com/temporalio/sqlparser/commit/1aae9baceee8e48525da8f56b07bf6a5ca7eb147>
- patch: <https://github.com/temporalio/sqlparser/pull/6>
- patch: <https://github.com/temporalio/sqlparser/commit/0466b6b405accfaa781e4bef417933efc18bcaef>
- patch: <https://github.com/temporalio/sqlparser/pull/7>
- patch: <https://github.com/temporalio/temporal/pull/11202>
- other: <https://github.com/temporalio/sqlparser/tree/v0.1.0>
- other: <https://github.com/temporalio/temporal/blob/v0.10.0/common/archiver/filestore/queryParser.go#L77-L132>
- other: <https://github.com/temporalio/temporal/releases/tag/v1.30.7>
- other: <https://github.com/temporalio/temporal/releases/tag/v1.31.3>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-65651>

HTML: <https://flawdb.com/CVE-2026-65651> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-65651>
