The vulnerability lies in the PlainSASLMechanismHandler.processSASLBind method, which failed to perform a necessary 'mayProxy' ACI scope check when a SASL PLAIN bind included an authzid for a different user. The patch introduces a checkProxyAccess method within PlainSASLMechanismHandler that calls a new, shared SASLContext.hasProxyAccess method. This new method centralizes the proxy access control logic, ensuring that both SASL PLAIN and other mechanisms like DIGEST-MD5/GSSAPI consistently enforce the ACI scope grant. The SASLContext.hasPermission method was also modified to use this new shared logic, making it a relevant part of the patched code path, although the primary vulnerability was the lack of the check in PlainSASLMechanismHandler.