Skip to content

proposal: net: Disable MPTCP by default #82717

Open

Description

@Fangliding

Proposal Details

See https://www.anthropic.com/research/discovering-vulnerabilities-with-claude
Linux MPTCP listener can be attacked, and go listener listen MPTCP by default in 3d4daa3
This may expose all golang programs to this vulnerability

NOTE: It is currently unknown whether this vulnerability is strongly related to MPTCP

Activity

  1. added this to the Proposal milestone on Oct 29, 2026
  2. ianlancetaylor commented on Oct 29, 2026

    @ianlancetaylor
    Contributor

    CC @golang/security

  3. neild commented on Oct 29, 2026

    @neild
    Contributor

    We're actively looking at this.

    The root cause of CVE-2026-98432 is use-after-free condition in Linux's IPv4 TCP connection handling, and is not MPTCP-specific. The race occurs while handling TCP SYN packets containing IPv4 header options.

    Anthropic has described a proof-of-concept exploit which escalates this to remote root code execution. This exploit requires a system with an MPTCP listener.

    So far as I can tell, at this time nobody knows whether there is a viable path to RCE on a system which does not expose an MPTCP listener. Since the underlying race condition is not MPTCP-specific, I would recommend against hoping that there is not.

    As an immediate mitigation, it is possible that configuring the system packet filter to drop IPv4 TCP packets with IP options may suffice as defense. I have not confirmed this.

    Upgrading to a patched kernel is the best solution.

    As of Go 1.24, Go's net package enables MPTCP for listeners by default. To disable MPTCP by default, set GODEBUG=multipathtcp=0. Note again that while disabling MPTCP will prevent the specific exploit described by Anthropic, it does not disable the underlying kernel use-after-free condition and may not defend against all possible exploits.

    You may set this GODEBUG in the environment of an existing program, to change its default.

    You may also build a program with a different default by

    • placing a godebug multipathtcp=0 line in the main module's go.mod file; or
    • adding a //go:debug multipathtcp=0 line directly before the package main line.
  4. nicholashusin commented on Oct 29, 2026

    @nicholashusin
    Member
  5. added a commit that references this issue on Oct 30, 2026
  6. dlsniper commented on Oct 30, 2026

    @dlsniper
    Contributor

    I argue against disabling this by default.
    Mitigation exists for this, as described in the previous comment and can be applied without recompiling the apps.
    Given this is a third-party issue that's likely to be fixed outside of Go's control, I'd rather not change anything to Go.

    Given this has been fixed upstream, it's up to the maintainers of the platforms to deploy the latest Kernel and ensure the security of their apps rather than of a programming language/library to change how it works in case they environment may not have the patch.

    Disabling this now will open the door to other requests to mitigate vulnerabilities rather than pushing the admins to patch the hosts.

    Plus, not everyone updates to the latest and greatest Go version.
    I'd much rather be informed via a security email like the one sent already of a security problem and how it can be fixed than have to upgrade Go.

  7. neild commented on Oct 30, 2026

    @neild
    Contributor

    What is the argument for enabling MPTCP by default?

    There was a lot of discussion in #56539, but I don't see a definitive answer to this. The clearest argument in favor I see is #56539 (comment), in which @rsc said:

    This does feel a lot like adding support for HTTP/2 or TLS 1.3, both of which did not require users to modify their programs to get the newer, better protocols. It seems like the right end state is for Go programs to "do the right thing" and use MPTCP whenever that makes sense in place of plain TCP for dialed "tcp" connections. Programs shouldn't have to update to take advantage of the new protocol. Of course we don't want to break people either, if MPTCP would break them. See my recent Compatibility talk for more of my thinking about these kinds of changes.

    I am inclined to say that we add MPTCP as an opt-in for a release or two, and then make it opt-out.

    The argument is that MPTCP is "the right thing" if available, and therefore we should enable support for it when possible.

    Is this true, though? So far as I know, Go's net package is unique in enabling MPTCP support by default. Surely if it's the right thing, someone else would enable it by default. To take the analogy with TLS, TLS 1.3 is an unquestionable upgrade from 1.2 and any reasonable TLS stack will use it when supported by the peer.

    #56539 (comment) from @mattbe also contains this rather painfully prescient comment:

    One last thing is that because we add more features, there is always a risk of discovering new issues or new "misuses" including security issues. From a security point of view, the protocol has been deeply analysed. Even if fixes can come quickly, there can be some issues in the code and that's another reason why network maintainer didn't want to have MPTCP enabled by default.

    I don't think it makes sense to change the multipathtcp GODEBUG default from 2 (enabled on listeners only) to 0 (not enabled) as a security fix; this is closing the barn door after the horse has left. But I think we should ask whether leaving it enabled makes sense from a general correctness perspective.

    So: What's the argument for enabling MPTCP by default? What specific, practical benefits does this bring to users right now? What harm is caused by changing the default to be consistent with (so far as I can tell) every other networking library out there?

  8. brandond commented on Oct 30, 2026

    @brandond

    What harm is caused by changing the default to be consistent with (so far as I can tell) every other networking library out there?

    What justification is there for changing core library features based on cargo-cult imitation of other languages core libraries? If nobody does anything because nobody else is doing it, then nothing ever improves.

  9. ianlancetaylor commented on Oct 30, 2026

    @ianlancetaylor
    Contributor

    If we believe the advantages of MPTCP, then it seems to clearly make sense to enable it by default. It improves network transmission when it is available, and it falls back seamlessly when it is not.

    In general before this security issue I believe that the only complaint has been #74643, which was closed with no action taken.

    I'm not in any way wedded to MPTCP. But I don't see any reason that a security issue should lead us to disable it. This is especially true given that the security issue at least potentially affects regular TCP, and it has already been patched, and there is any easy way to avoid it without waiting for the patch.

  10. matttbe commented on Oct 30, 2026

    @matttbe
    Contributor

    So: What's the argument for enabling MPTCP by default? What specific, practical benefits does this bring to users right now? What harm is caused by changing the default to be consistent with (so far as I can tell) every other networking library out there?

    By having MPTCP enabled by default on the listener side, it helps clients to easily benefit from MPTCP: seamless handovers, best network selection, network aggregation, etc. As mentioned on the mptcp.dev website, having a listening MPTCP socket is cheap and, when MPTCP is not requested by the client, "plain" TCP sockets will continue to be used by the server, so no perf impact for existing traffic.

    While I'm here, for the people who are worry about this CVE, please note that the reproducer used by Anthropic in their "ad" was in a lab, sending a huge number of connections requests, using MPTCP because by luck it "only" took them 48 minutes, less than with TCP, and I'm pretty sure IPv4 options are already blocked in many networks by default for different security reasons. So it seems very unlikely to have this attack working outside a lab. I have no idea how they got a 9.8 score in some places, but I agree that it helped them to make a good press release / ad thanks to that.

    There are heaps of security fixes in the kernel each week, simply update regularly. To better illustrate that, please check this presentation from Greg KH.

  11. neild commented on Oct 31, 2026

    @neild
    Contributor

    (To be clear, I'm not arguing for changing the default. I'm also not arguing for not changing the default. I just want us to have a good reason for the default, whatever it may be.)

    If enabling MPTCP for listeners by default is the right thing, why isn't that done at a system-wide level for all listen sockets?

    Why don't any platforms other than Go enable MPTCP by default? (Or do some, and I just don't know about it?) Should we expect other languages' standard libraries to start doing this in the future? Or for applications written in non-Go languages to start conventionally enabling it? For example, I see that nginx appears to have MPTCP support, but it defaults to off.

  12. matttbe commented on Oct 31, 2026

    @matttbe
    Contributor

    If enabling MPTCP for listeners by default is the right thing, why isn't that done at a system-wide level for all listen sockets?

    It is possible to do so, but the Linux network maintainers wouldn't want to: applications should control what they want, be in control, and request new features (if available). That's what is done with all new major features, and that's why there are so many socket options, sysctl, and other settings via netlink. Plus in some cases, there is no need to use MPTCP (localhost, when there is only one possible path and no migrations, when always talking to a stack not supporting MPTCP, when specific HW acceleration are used, etc.) so for the kernelspace where every byte is important, such feature cannot be enabled by default.

    Why don't any platforms other than Go enable MPTCP by default? (Or do some, and I just don't know about it?) Should we expect other languages' standard libraries to start doing this in the future? Or for applications written in non-Go languages to start conventionally enabling it? For example, I see that nginx appears to have MPTCP support, but it defaults to off.

    In my point of view, Go is a bit specific: it tries to do "good things" by default, with many socket options being set, trying to force using latest security, etc. That's great, but that's not what many other standard lib are doing. Maybe that's because of the ecosystem, with many tests where you can be confident enough to bring nice improvements to everybody. And it looks like that was a good move: I didn't hear people complaining (except for a specific use-case with BGP and TCP MD5)... until this week just because MPTCP was used in this publicized exploitation path in TCP :)
    For "older" projects like nginx, they seem to be extremely cautious and try not to modify any default behaviour. It is up to the user to find out about the new features and turn them on. Having Go supporting MPTCP seems to be a good sign then.

  13. database64128 commented on Oct 31, 2026

    @database64128
    Contributor

    For example, I see that nginx appears to have MPTCP support, but it defaults to off.

    IMO nginx isn't a particularly great example when it comes to defaults:

    • HTTP/2 is disabled by default, unless you write http2 on;
    • sendfile is disabled by default, unless you write sendfile on;
    • charset defaults to off, unless you write charset utf-8;
    • worker_processes defaults to 1, unless you write worker_processes auto;

    All of the above have saner defaults in Go's standard library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions