mirror of
https://github.com/deepseek-ai/DeepSeek-R1.git
synced 2026-11-05 00:47:42 +00:00
[GH-ISSUE #537] Potential Vulnerability: Context Injection via RAG Bypasses Content Filtering #425
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepSeek-R1#425
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rogerganga on GitHub (Mar 5, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/537
I have observed that when external context is added via Retrieval-Augmented Generation (RAG), the model’s content filtering appears to be bypassed. Specifically, if a user provides a document containing information that would normally be blocked in a direct query, the model generates a complete response based on that context.
While my experiments are based on a generic demonstration, this pattern indicates a potential vulnerability: sensitive or otherwise restricted content might be indirectly retrieved and then output, even though the model is designed to refuse such content when directly queried.
Steps to Reproduce:
Use the attached reference code which:
Run the code with a query and observe that:
Model Used:
deepseek-r1:1.5b. I ran this model using Ollama
Reference Code:
Expected Behavior:
Actual Behavior:
Impact:
This behavior indicates a potential vulnerability in how RAG is integrated within the model. If exploited, it might allow users to circumvent content filtering by embedding sensitive or restricted information within context documents. This could have broader implications for both content moderation and AI safety.
Recommendation:
Consider implementing an additional safety layer that evaluates the aggregated prompt (query + context) before generating a response
@github-actions[bot] commented on GitHub (Apr 17, 2025):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!
@github-actions[bot] commented on GitHub (May 20, 2025):
false