arXiv:2602.22427cs.CRcs.AI2026-02被引 2

发现并检测RAG系统中被恶意注入的高频检索项,提升AI知识调用安全性。

Adversarial Hubness Detector: Detecting Hubness Poisoning in Retrieval-Augmented Generation Systems

  • 通过统计分析、聚类扩散和查询扰动测试多维度识别异常高频检索项
  • 在多个数据集上实现90%召回率(误报率仅0.2%),最高达100%召回
  • 支持多种向量库与检索方式,适合部署于真实生产环境的安全审计

检索增强生成(RAG)系统依赖向量相似性搜索获取外部知识,但面临严重安全威胁:hubness——即某些条目在大量不同查询中频繁出现在前k位结果。这些高频项可被恶意利用,引入有害内容、篡改排序、绕过过滤并降低性能。本文提出hubscan,一款开源安全扫描工具,用于检测向量索引与嵌入中的异常高频项。其采用多检测器架构:(1)基于中位数与绝对偏差(MAD)的稳健统计检测;(2)聚类间扩散分析以评估跨集群检索模式;(3)对查询扰动的稳定性测试;(4)面向领域与模态的检测能力,应对特定类别及跨模态攻击。该工具兼容FAISS、Pinecone、Qdrant、Weaviate等向量数据库,支持向量相似度、混合搜索与词法匹配+重排序。我们在Food-101、MS-COCO、FiQA三个对抗性hubness基准上测试,采用先进梯度优化与质心生成方法构造攻击样本。结果表明,hubscan在0.2%告警预算下达到90%召回率,0.4%时达100%召回,且对抗性枢纽均位于99.8百分位以上。领域限定扫描成功捕获100%逃逸全局检测的针对性攻击。在包含100万真实网页文档的MS MARCO生产环境中验证,清洁文档与恶意内容得分显著分离。

原文摘要 · Abstract (English)

Retrieval-Augmented Generation (RAG) systems are essential to contemporary AI applications, allowing large language models to obtain external knowledge via vector similarity search. Nevertheless, these systems encounter a significant security flaw: hubness - items that frequently appear in the top-$k$ retrieval results for a disproportionately high number of varied queries. These hubs can be exploited to introduce harmful content, alter search rankings, bypass content filtering, and decrease system performance. We introduce hubscan, an open-source security scanner that evaluates vector indices and embeddings to identify hubs in RAG systems. Hubscan presents a multi-detector architecture that integrates: (1) robust statistical hubness detection utilizing median/Median Absolute Deviation (MAD)-based z-scores, (2) cluster spread analysis to assess cross-cluster retrieval patterns, (3) stability testing under query perturbations, and (4) domain-aware and modality-aware detection for category-specific and cross-modal attacks. Our solution accommodates several vector databases (FAISS, Pinecone, Qdrant, Weaviate) and offers versatile retrieval techniques, including vector similarity, hybrid search, and lexical matching with reranking capabilities. We evaluate hubscan on Food-101, MS-COCO, and FiQA adversarial hubness benchmarks constructed using state-of-the-art gradient-optimized and centroid-based hub generation methods. Hubscan achieves 90% recall at a 0.2% alert budget and 100% recall at 0.4%, with adversarial hubs ranking above the 99.8th percentile. In testing, domain-scoped scanning recovered 100% of targeted attacks that evaded global detection. Production validation on 1M real web documents from MS MARCO demonstrates significant score separation between clean documents and adversarial content.

RAG安全异常检测向量检索对抗攻击

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。