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
- is related to
-
GODRIVER-3772 Add AddressSanitizer support for GSSAPI enterprise auth tests
-
- Backlog
-