Heap Out-of-Bounds Read in GSSAPI Error Handling

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 2.4.2, 1.17.7
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Go Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      The gssapi_error_desc and gssapi_client_username functions read one byte past the end of GSS library buffers by copying length+1 bytes from buffers that only contain length bytes. This could cause a crash (e.g. DoS) if the GSS library returns buffers allocated at page boundaries, as the driver reads one byte past the buffer end.

      Repro: 

      CGO_CFLAGS="-fsanitize=address" CGO_LDFLAGS="-fsanitize=address" MONGODB_URI="mongodb://fakeuser@localhost:27017/admin?authMechanism=GSSAPI" go run -tags gssapi ./internal/cmd/testentauth/main.go 

            Assignee:
            Preston Vasquez
            Reporter:
            Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: