ExportXMLWordPrintableJSON

    • Server Security
    • Fully Compatible
    • ALL
    • v9.0, v8.3, v8.0, v7.0
    • Server Security 2026-11-20
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      On Windows (SChannel TLS), mongod can crash with Unhandled exception (access violation) / DEP violation on the very first inbound TLS connection, shortly after startup. The faulting instruction pointer is inside Schannel.dll, which the crash dump lists under "Unloaded modules".

      MONGO_INITIALIZER(InitializeSchannelGetServerIdentityFn) in src/mongo/util/net/ssl/detail/impl/schannel.ipp caches the raw SslGetServerIdentity pointer and then releases its only reference to the library (~SharedLibrary in src/mongo/platform/shared_library_windows.cpp calls FreeLibrary). Schannel.dll is unloaded at startup. The first server-side handshake loads it again via AcquireCredentialsHandleW, and the SNI extraction at schannel.ipp (_sslGetServerIdentityFn(...), run for every server handshake) calls through the cached pointer.

      If Windows maps Schannel.dll at the same base address the stale pointer happens to work. If it maps it at a different base, the call jumps into unmapped memory, which gives an execute fault and a process crash. This is why the failure is rare and not tied to timing.

            Assignee:
            Erwin Pe
            Reporter:
            Erwin Pe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: