arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.10534cs.CRcs.AIcs.SE
收藏

基于机器学习的MCP攻击检测

Machine Learning-Based Detection of MCP Attacks

Blekinge Institute of Technology(布莱金厄理工学院);Ericsson(爱立信)

Tobias Mattsson, Samuel Nyberg, Anton Borg, Ricardo Britto

AI总结:

本文研究了MCP攻击检测问题,提出并评估了多种监督机器学习方法,包括传统和深度学习模型,通过二分类和多分类任务验证了模型的有效性,展示了机器学习在区分恶意与良性数据中的优势。

摘要:

模型上下文协议(MCP)是一种新兴技术,扩展了大语言模型的功能,改进了工作流程但也暴露了新的攻击面。已有研究指出了相关安全漏洞,但MCP攻击检测仍被忽视。为填补这一研究空白,本文开发并评估了多种监督机器学习方法,包括传统和深度学习模型。在两个场景中评估了系统对恶意MCP工具描述的检测:(1)二分类任务区分恶意与良性工具;(2)多分类任务识别攻击类型并分离良性与恶意工具。除了机器学习模型,还比较了基于规则的方法作为基线。结果表明,几种模型在二分类任务中实现了100%的F1分数。在多分类场景中,SVC和BERT模型表现最佳,分别达到90.56%和88.33%的F1分数。混淆矩阵用于可视化预测分布,为选择最佳解决方案提供了额外见解。本文为MCP防御领域提供了新贡献,展示了机器学习模型在区分恶意与良性数据中的优异表现。为在实际环境中应用解决方案,开发了中间件以在执行前分类哪些MCP工具是安全的,哪些不安全并阻止它们。此外,研究还表明这些模型可以超越目前在领域内使用的传统规则方法。

英文摘要:

The Model Context Protocol (MCP) is a new and emerging technology that extends the functionality of large language models, improving workflows but also exposing users to a new attack surface. Several studies have highlighted related security flaws, but MCP attack detection remains underexplored. To address this research gap, this study develops and evaluates a range of supervised machine learning approaches, including both traditional and deep-learning models. We evaluated the systems on the detection of malicious MCP tool descriptions in two scenarios: (1) a binary classification task distinguishing malicious from benign tools, and (2) a multiclass classification task identifying the attack type while separating benign from malicious tools. In addition to the machine learning models, we compared a rule-based approach that serves as a baseline. The results indicate that several of the developed models achieved 100\% F1-score on the binary classification task. In the multiclass scenario, the SVC and BERT models performed best, achieving F1 scores of 90.56\% and 88.33\%, respectively. Confusion matrices were also used to visualize the full distribution of predictions often missed by traditional metrics, providing additional insight for selecting the best-fitting solution in real-world scenarios. This study presents an addition to the MCP defence area, showing that machine learning models can perform exceptionally well in separating malicious and benign data points. To apply the solution in a live environment, a middleware was developed to classify which MCP tools are safe to use before execution, and block the ones that are not safe. Furthermore, the study shows that these models can outperform traditional rule-based solutions currently in use in the field.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑