Skip to content

[Security Fix]: Fix the Cypher safety bypass vulnerabilities#291

Open
oussamahansal wants to merge 3 commits into
mainfrom
cypher-execution-safety-check
Open

[Security Fix]: Fix the Cypher safety bypass vulnerabilities#291
oussamahansal wants to merge 3 commits into
mainfrom
cypher-execution-safety-check

Conversation

@oussamahansal
Copy link
Copy Markdown
Collaborator

Description of changes:

  • Fix the Cypher safety bypass vulnerabilities in GraphQueryRetriever.is_query_safe() by hardening the method with comment stripping, Unicode normalization, expanded blocklist (including CALL), restoring the block_graph_modification flag, and adding driver-level read-only enforcement via NeptuneAnalyticsGraphStore.execute_query().

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions
Copy link
Copy Markdown

BYOKG-RAG Coverage Report: The coverage is at unknown% (target: unknown%). Download the HTML report here.

@github-actions
Copy link
Copy Markdown

BYOKG-RAG Coverage Report: The coverage is at 94.25% (target: 80%). Download the HTML report here.

Copy link
Copy Markdown
Collaborator

@acarbonetto acarbonetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments to address.

Comment thread byokg-rag/tests/unit/graph_retrievers/test_graph_retrievers.py Outdated
Comment thread byokg-rag/tests/unit/graph_retrievers/test_graph_retrievers.py Outdated
Copy link
Copy Markdown
Collaborator

@acarbonetto acarbonetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a integration test for this? We should add this test to the short playlist.

@oussamahansal oussamahansal requested a review from acarbonetto June 2, 2026 15:55
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

BYOKG-RAG Coverage Report: The coverage is at 94.25% (target: 80%). Download the HTML report here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants