VYPR
High severityNVD Advisory· Published Feb 4, 2023· Updated Mar 26, 2025

Apache AGE: Python and Golang drivers allow data manipulation and exposure due to SQL injection

CVE-2022-45786

Description

There are issues with the AGE drivers for Golang and Python that enable SQL injections to occur. This impacts AGE for PostgreSQL 11 & AGE for PostgreSQL 12, all versions up-to-and-including 1.1.0, when using those drivers.

The fix is to update to the latest Golang and Python drivers in addition to the latest version of AGE that is used for PostgreSQL 11 or  PostgreSQL 12.

The update of AGE will add a new function to enable parameterization of the cypher() function, which, in conjunction with the driver updates, will resolve this issue.

Background (for those who want more information):

After thoroughly researching this issue, we found that due to the nature of the cypher() function, it was not easy to parameterize the values passed into it. This enabled SQL injections, if the developer of the driver wasn't careful. The developer of the Golang and Pyton drivers didn't fully utilize parameterization, likely because of this, thus enabling SQL injections.

The obvious fix to this issue is to use parameterization in the drivers for all PG SQL queries. However, parameterizing all PG queries is complicated by the fact that the cypher() function call itself cannot be parameterized directly, as it isn't a real function. At least, not the parameters that would take the graph name and cypher query.

The reason the cypher() function cannot have those values parameterized is because the function is a placeholder and never actually runs. The cypher() function node, created by PG in the query tree, is transformed and replaced with a query tree for the actual cypher query during the analyze phase. The problem is that parameters - that would be passed in and that the cypher() function transform needs to be resolved - are only resolved in the execution phase, which is much later. Since the transform of the cypher() function needs to know the graph name and cypher query prior to execution, they can't be passed as parameters.

The fix that we are testing right now, and are proposing to use, is to create a function that will be called prior to the execution of the cypher() function transform. This new function will allow values to be passed as parameters for the graph name and cypher query. As this command will be executed prior to the cypher() function transform, its values will be resolved. These values can then be cached for the immediately following cypher() function transform to use. As added features, the cached values will store the calling session's pid, for validation. And, the cypher() function transform will clear this cached information after function invocation, regardless of whether it was used.

This method will allow the parameterizing of the cypher() function indirectly and provide a way to lock out SQL injection attacks.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

SQL injection via AGE Golang and Python drivers up to version 1.1.0 due to insufficient parameterization of the cypher() function in PostgreSQL 11 and 12.

Vulnerability

Overview

CVE-2022-45786 describes SQL injection vulnerabilities in the Golang and Python drivers for Apache AGE, a graph extension for PostgreSQL. The issue affects AGE for PostgreSQL 11 and 12, versions up to and including 1.1.0, when using these drivers. The root cause is insufficient parameterization of the cypher() function, which the drivers use to execute openCypher queries against the graph. According to the advisory, the cypher() function is a placeholder that is transformed during query analysis, and its parameters (graph name and cypher query) cannot be directly parameterized because they are resolved after the transformation phase. This limitation led the driver developers to not fully parameterize the function inputs, opening the door for SQL injection [1][2].

Exploitation and

Impact

An attacker who can influence the graph name or cypher query string passed to the driver—likely through application inputs—could craft malicious SQL that gets executed in the PostgreSQL backend. The vulnerability does not require special authentication beyond the normal application user; any input that eventually reaches the AGE driver is a potential vector. Successful exploitation allows the attacker to execute arbitrary SQL commands on the PostgreSQL server, potentially reading, modifying, or deleting data, or escalating privileges within the database [2].

Mitigation

The fix involves updating both the AGE core extension (version 1.1.0 or later) and the corresponding Golang and Python drivers to the latest versions. The AGE update introduces a new function that enables parameterization of the cypher() function, which, combined with driver updates that properly use parameterized queries, resolves the injection risk. Users are advised to apply these updates as soon as possible [1][2].

AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/apache/age/drivers/golangGo
< 1.1.11.1.1
apache-age-pythonPyPI
< 0.0.50.0.5

Affected products

4

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

3

News mentions

0

No linked articles in our index yet.