CVE-2022-45786
Apache AGE: Python and Golang drivers allow data manipulation and exposure due to SQL injection
Also known as GHSA-6p5q-h963-pwwf, GO-2024-2587, PYSEC-2026-769
Mitigation
- Upgrade apache-age-python to 0.0.5 or later.
- Upgrade github.com/apache/age/drivers/golang to 1.1.1 or later.
Who should check
- Projects that depend on PyPI package apache-age-python (< 0.0.5)
- Projects that depend on Go package github.com/apache/age/drivers/golang (< 1.1.1)
- Anyone running Apache Software Foundation Apache AGE >= Apache AGE for PostgreSQL 12, <= 1.1.0; >= Apache AGE for PostgreSQL 11, <= 1.1.0
Vulnerability facts
- Affected
- apache-age-python < 0.0.5; github.com/apache/age/drivers/golang < 1.1.1
- Fixed in
- 0.0.5, 1.1.1
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 8.1 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: High
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 1.16% chance of exploitation in 30 days (percentile 67, 2026-11-26)
- CWE
- CWE-89
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI apache-age-python | < 0.0.5 | 0.0.5 | osv |
| Go github.com/apache/age/drivers/golang | < 1.1.1 | 1.1.1 | osv |
| Apache Software Foundation Apache AGE | >= Apache AGE for PostgreSQL 12, <= 1.1.0; >= Apache AGE for PostgreSQL 11, <= 1.1.0 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2022-45786. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2022-45786.md Affected: apache-age-python < 0.0.5; github.com/apache/age/drivers/golang < 1.1.1 Fixed in: 0.0.5, 1.1.1 Steps: 1. Search this machine and project for apache-age-python (PyPI), github.com/apache/age/drivers/golang (Go), Apache Software Foundation Apache AGE: 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.
References
Vendor advisories
FAQ
Is CVE-2022-45786 being exploited?
There is no confirmed exploitation: CVE-2022-45786 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.16% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2022-45786?
High: CVSS 8.1 (v3.1, scored by CNA). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2022-45786?
apache-age-python < 0.0.5; github.com/apache/age/drivers/golang < 1.1.1.
Is there a fix for CVE-2022-45786?
Yes. Fixed in 0.0.5, 1.1.1. Upgrade apache-age-python to 0.0.5 or later. Upgrade github.com/apache/age/drivers/golang to 1.1.1 or later.
How do I check if I'm affected by CVE-2022-45786?
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.