RAG Becomes a New Attack Surface: How Attention Mechanisms Guard AI Knowledge Base Security