arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.05260cs.CR
收藏

SecureMCP: 一种通过模型上下文协议实现的基于策略的LLM数据访问框架,用于AIoT系统

SecureMCP: A Policy-Enforced LLM Data Access Framework for AIoT Systems via Model Context Protocol

Data Science Lab Co., Ltd.(数据科学实验室有限公司)

Wonbae Kim, Hee-Kyong Yoo

AI总结:

本文提出SecureMCP框架,结合RBAC与MCP服务器,通过五种防御模块实现多层防护,提升LLM生成SQL的安全性,实验显示其在保护数据安全和执行准确率方面表现优异。

摘要:

在人工智能物联网(AIoT)系统中部署大型语言模型(LLM)生成的SQL查询引入了关键安全风险,因为提示注入攻击可以操纵LLM生成未经授权的查询,暴露敏感数据或执行破坏性操作。现有NL2SQL研究侧重于查询准确性,而MCP服务器实现仅提供SQL级保护,缺乏细粒度的角色基础访问控制。本文提出SecureMCP,一种集成了角色基础访问控制(RBAC)与MCP服务器的LLM数据访问框架,以建立多层防御。该框架包含五个防御模块——check_policy用于表和列级RBAC,explain_gate用于阻止成本爆炸式查询,SQL Interceptor用于检测危险模式,Risk Level Filter用于SQL风险分类,DB Isolation用于跨数据库限制——这些模块在顺序失败关闭的管道中运行,映射到基于OWASP Top 10的六种提示注入类型。我们评估SecureMCP在IoT-SQL数据集(11张表,173列,239,398条记录)上使用Qwen3-8B。实验A显示,防御模块保持执行准确率,EX-in-ALLOW在四个RBAC角色中保持在65.1%-76.4%之间,与无保护基线63.8%相当。实验B显示,SecureMCP在2,400个对抗性查询上实现了82.3%的政策合规性,真实防御失败仅限于3.4%。防御纵深分析显示check_policy占78.7%的阻塞,而次级模块贡献了额外的17.5个百分点的改进。注入纳入率为72.5%,证实了LLM的高易受性,确立了外部策略强制的必要性。

英文摘要:

The deployment of Large Language Model (LLM)-generated SQL queries in Artificial Intelligence of Things (AIoT) systems introduces critical security risks, as prompt injection attacks can manipulate LLMs into producing unauthorized queries that expose sensitive data or execute destructive operations. Existing NL2SQL research focuses on query accuracy, while MCP server implementations provide only SQL-level protections without fine-grained role-based access control. This paper proposes SecureMCP, a policy-enforced LLM data access framework integrating Role-Based Access Control (RBAC) with an MCP server to establish multi-layer defense for LLM-generated SQL execution. The framework incorporates five defense modules -- check_policy for table-and-column-level RBAC, explain_gate for cost-explosive query blocking, SQL Interceptor for dangerous pattern detection, Risk Level Filter for SQL risk classification, and DB Isolation for cross-database restriction -- operating in a sequential fail-closed pipeline mapped to six prompt injection types grounded in the OWASP Top 10 for LLM Applications. We evaluate SecureMCP on the IoT-SQL dataset (11 tables, 173 columns, 239,398 records) using Qwen3-8B. Experiment A demonstrates that defense modules preserve execution accuracy, with EX-in-ALLOW remaining within 65.1%-76.4% across four RBAC roles, matching the unprotected baseline of 63.8%. Experiment B shows that SecureMCP achieves 82.3% Policy Compliance on 2,400 adversarial queries, with genuine defense failures limited to 3.4%. The defense-in-depth analysis reveals check_policy accounts for 78.7% of blocks, while secondary modules contribute an additional 17.5 percentage-point improvement. The Injection Incorporation Rate of 72.5% confirms high LLM susceptibility, establishing the necessity of external policy enforcement.

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

↑