PYSEC-2026-2504

See a problem?
Import Source
https://github.com/pypa/advisory-database/blob/main/vulns/graphiti-core/PYSEC-2026-2504.yaml
JSON Data
https://api.osv.dev/v1/vulns/PYSEC-2026-2504
Aliases
Published
2026-07-13T14:36:42.548518Z
Modified
2026-07-13T16:31:56.101600093Z
Severity
  • 8.1 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N CVSS Calculator
Summary
Graphiti vulnerable to Cypher Injection via unsanitized node_labels in search filters
Details

Summary

Graphiti versions before 0.28.2 contained a Cypher injection vulnerability in shared search-filter construction for non-Kuzu backends. Attacker-controlled label values supplied through SearchFilters.node_labels were concatenated directly into Cypher label expressions without validation.

In MCP deployments, this was exploitable not only through direct untrusted access to the Graphiti MCP server, but also through prompt injection against an LLM client that could be induced to call search_nodes with attacker-controlled entity_types values. The MCP server mapped entity_types to SearchFilters.node_labels, which then reached the vulnerable Cypher construction path.

Affected backends included Neo4j, FalkorDB, and Neptune. Kuzu was not affected by the label-injection issue because it used parameterized label handling rather than string-interpolated Cypher labels.

This issue was mitigated in 0.28.2.

Affected Versions

  • 0.28.1 and earlier

Fixed Version

  • 0.28.2

Affected Components

  • Graphiti Core search filter construction
  • Graphiti MCP Server search_nodes when used by an LLM client processing untrusted prompts

Technical Details

Before 0.28.2, Graphiti joined SearchFilters.node_labels with | and inserted the result directly into Cypher label expressions in the shared search-filter constructors used by non-Kuzu providers.

The vulnerable logic was effectively:

  • node_labels = '|'.join(filters.node_labels)
  • node_label_filter = 'n:' + node_labels

The same pattern was also used in edge-search filter construction.

In MCP deployments, search_nodes accepted an entity_types argument and passed it directly to SearchFilters(node_labels=entity_types). An attacker who could influence prompts processed by an LLM client with Graphiti MCP access could use prompt injection to steer the model into invoking search_nodes with crafted entity_types values containing Cypher syntax. Those values would then be interpolated into Cypher before 0.28.2.

Impact

Successful exploitation could allow arbitrary Cypher execution within the privileges of the configured graph database connection, including:

  • reading graph data outside the intended search scope
  • modifying graph data
  • deleting graph data
  • bypassing logical group isolation enforced at the query layer

Additional Note on group_ids

Separately, the original report also identified a narrower issue in fulltext search query construction for unvalidated group_ids. That issue was distinct from the Cypher label-injection path described above and was also mitigated in 0.28.2.

Mitigation

Upgrade to 0.28.2 or later.

Version 0.28.2 added:

  • validation of SearchFilters.node_labels
  • defense-in-depth label validation in shared search-filter constructors
  • validation of entity node labels in persistence query builders
  • validation of group_ids in shared search fulltext helpers

Workarounds

If you cannot upgrade immediately:

  • do not expose Graphiti MCP tools to untrusted users or to LLM workflows that process untrusted prompt content
  • avoid passing untrusted values into SearchFilters.node_labels or MCP entity_types
  • restrict graph database credentials to the minimum privileges required

Credits

@4n93L for their original report.

References

Affected packages

PyPI / graphiti-core

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.28.2

Affected versions

0.*
0.1.0
0.2.0
0.2.1
0.2.2
0.2.3
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.3.5
0.3.6
0.3.7
0.3.8
0.3.9
0.3.11
0.3.12
0.3.13
0.3.14
0.3.15
0.3.16
0.3.17
0.3.18
0.3.19
0.3.20
0.3.21
0.4.0
0.4.1
0.4.2
0.4.3
0.5.0rc1
0.5.0rc2
0.5.0rc3
0.5.0rc4
0.5.0rc5
0.5.0
0.5.1
0.5.2
0.5.3
0.6.0
0.6.1
0.7.0
0.7.1
0.7.2
0.7.3
0.7.4
0.7.5
0.7.6
0.7.7
0.7.8
0.7.9
0.8.0
0.8.1
0.8.2
0.8.3
0.8.4
0.8.5
0.8.6
0.8.7
0.8.8
0.9.0
0.9.1
0.9.2
0.9.3
0.9.4
0.9.5
0.9.6
0.10.0
0.10.1
0.10.2
0.10.3
0.10.4
0.10.5
0.11.0
0.11.1
0.11.2
0.11.3
0.11.4
0.11.5
0.11.6rc1
0.11.6rc2
0.11.6rc3
0.11.6rc4
0.11.6rc5
0.11.6rc6
0.11.6rc7
0.11.6rc9
0.11.6
0.12.0rc1
0.12.0rc2
0.12.0rc3
0.12.0rc4
0.12.0rc5
0.12.0
0.12.1
0.12.2
0.12.3
0.12.4
0.13.0
0.13.1
0.13.2
0.14.0
0.15.0
0.15.1
0.16.0
0.17.0
0.17.1
0.17.2
0.17.3
0.17.4
0.17.5
0.17.6
0.17.7
0.17.8
0.17.9
0.17.10
0.17.11
0.18.0
0.18.1
0.18.2
0.18.3
0.18.4
0.18.5
0.18.6
0.18.7
0.18.8
0.18.9
0.19.0rc1
0.19.0rc2
0.19.0rc3
0.19.0
0.20.0
0.20.1
0.20.2
0.20.3
0.20.4
0.21.0rc1
0.21.0rc2
0.21.0rc3
0.21.0rc4
0.21.0rc5
0.21.0rc6
0.21.0rc7
0.21.0rc8
0.21.0rc9
0.21.0rc10
0.21.0rc11
0.21.0rc12
0.21.0rc13
0.21.0
0.22.0rc0
0.22.0rc1
0.22.0rc2
0.22.0rc3
0.22.0rc4
0.22.0rc5
0.22.0
0.22.1rc1
0.22.1rc2
0.23.0
0.23.1
0.24.0
0.24.1
0.24.3
0.25.0
0.25.1
0.25.2
0.25.3
0.25.4
0.25.5
0.26.0
0.26.1
0.26.2
0.26.3
0.27.0rc1
0.27.0rc2
0.27.0
0.27.1
0.27.2rc1
0.28.0
0.28.1

Database specific

source
"https://github.com/pypa/advisory-database/blob/main/vulns/graphiti-core/PYSEC-2026-2504.yaml"