OAuth在MCP安全中的作用
OAuth's Role in MCP Security

原始链接: https://defensiblesystems.substack.com/p/oauths-role-in-mcp-security

虽然OAuth似乎是保护MCP集成的一个合乎逻辑的起点,但仅仅实现“标准”的OAuth部署会产生一种虚假的安全感,并留下关键的访问控制漏洞。OAuth本身并不能保证强大的身份验证,防止凭证重放,提供设备信息,启用基于属性的访问控制,或固有地限制横向移动。虽然可以监控OAuth日志,但这需要付出大量的额外努力。 核心问题在于,OAuth本身只提供基本的身份信息,并且本身并不适应MCP新的集成层的细微之处。这可能导致权限过度,因为现有的OAuth权限无法无缝地转换为LLM和代理与各种API交互的上下文。 为了真正保护MCP的安全,组织必须超越基本的OAuth实现。他们应该专注于构建强大的身份代理,并根据属性、角色、操作和语义调整访问策略,仔细地将这些策略映射到MCP暴露的新攻击面。本质上,OAuth提供了一个基础,但真正的工作在于根据MCP的具体需求和风险对其进行调整。

Hacker News 最新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 OAuth 在 MCP 安全中的作用 (defensiblesystems.substack.com) mooreds 2 小时前 6 分 | 隐藏 | 过去 | 收藏 | 1 评论 gsibble 10 分钟前 [–] 我认为这篇文章不太好。MCP 的设计使得集成像 OAuth 这样的东西非常困难。你要使用什么回调 URL?你该如何传递令牌以避免被 LLM 提供商存储?等等。 回复 加入我们 6 月 16-17 日在旧金山举办的 AI 初创企业学校! 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系我们 搜索:
相关文章
  • MCP 的一切问题 2025-04-14
  • (评论) 2025-04-14
  • 2025-04-14
  • MCP中的“S”代表安全。 2025-04-06
  • (评论) 2025-04-06

  • 原文

    The NSA likes to say, we don’t break standards, we break implementations. In that spirit let’s look at how OAuth may perform, as implemented in current practice, for MCP.

    Anthropic announced Model Context Protocol (MCP) last November and it has attracted tons of attention as a simple way to plug in models, tools, and APIs. This means security teams need to pivot quickly to provide solutions for this new integration layer.

    On a first pass, OAuth seems a logical starting point for an identity layer to underpin MCP flows. After all, OAuth is already in use for many API security systems. Indeed for most Infosec teams tackling MCP here and now, OAuth is the starting point for addressing MCP security.

    However, there are some reasons to be concerned if, in practice, OAuth will improve security or degrade it. Let's start with identity protocols generally, they do not "solve" access control, instead the identity protocols give a way to transform an access decision (i.e. delegation) and move it around in a networked system. Since MCP provides a new integration layer for LLMs and agents, it is reasonable to expect that unexpected linkages will occur due to the combination of multiple integration layers plugged together over MCP resulting in over-permissioned access to data because OAuth permissions are not by default tuned to the new target environment.

    Let's assume MCP achieves Anthropic's goal as a USB layer for LLMs and agents and becomes the de facto standard to plug in various APIs. What can OAuth reliably provide “out of the box” from a security perspective? Well, OAuth can mint a token with information about a client calling and what they are trying to gain access to, which then gives a recipient a start about mapping a caller and resource, but is that enough?

    Let's look at some specifics that OAuth does _not_ provide out of the box:

    • Do you want to ensure strong authentication? OAuth does not tell you about initial authentication types, and whether this was over phishing-resistant protocols.

    • Do you want to ensure the API requests are not using stolen credentials? OAuth does not let you know if this token is being replayed from a legit user or an attacker machine.

    • Do you want to know what device is running the request? OAuth does not tell you this.

    • Do you want to set access control policies based on attributes, roles, events, actions, or semantics? OAuth does not give you this.

    • Do you want to limit asset discovery and lateral movement? Like everything else, depends on the configuration, but in practice OAuth often makes this easier.

    • Do you want to monitor access, e.g. who is on the system now? OAuth server logs do tell you this, but you need to load them into your SOC/SIEM and write monitoring code.

    OAuth advocates (of which I am one) will argue that I am being unfair, of course, with different add ons, configurations, code, and certain OAuth profiles, you can bend the protocols to deliver some critical bits of much of the above. I am being deliberate to highlight the contrast here to show the gap between the things that Infosec teams typically want to get out of an access control system and compare that to what many teams deliver when they deliver a plain, vanilla, "we turned OAuth on, we're good" deployment. I believe that seeing many of these initial MCP efforts geared around "yes, we are hooking everything together with MCP, but we are ok, because OAuth will bail us out" will result in unexpected gaps like the above.

    I will note here, that the questions above are ones I would be a starter set of ones I would expect a security team to ask securing any API communication. This is all foundational before 1) tackling the challenge of the MCP server proxy itself and how do you want to delegate identity and access through it? and 2) the new risks that MCP exposes, many of which relate to semantics and data, which OAuth likewise does not address.

    Example of some policy zones left as open problems to solve in a MCP + OAuth flow

    New attack surfaces exposing limits of older security protocols built for different use case is not new. It is pretty similar to the early days of most technologies, when Apple Pay was turned on its fraud rates went through the roof immediately due to channels being left open, the early days of the web were rife with XSS and SQL Injection, etc. In the early days of Web services, one of Microsoft's stacks checked authentication by asking "did you send a certificate?" Not "did you send a valid certificate?"

    There are so many precedents here for technology running ahead and security catching up as quickly as we can. What is different now is that in early days of new developments of say eCommerce or Mobile Payments or Web services, these were wholly new areas so the risks were real but some what limited to the new stacks that companies deployed. In the case of MCP, the models consume enormous amounts of extant assets, meaning there is an inside out attack surface that is a new problem for Infosec teams to solve. That will be a topic for another post. What can OAuth do to provide some comfort to Infosec teams in the meantime? Infosec teams can look to OAuth as part of an identity access layer, but the real work is well beyond that, into the identity proxies, the first mile and last mile tuning to provide access based policy decisions that map to these new attack surfaces.

    联系我们 contact @ memedata.com