The vulnerability stems from the OKPAlgorithm.from_jwk function's failure to validate the consistency between the public key component ('x') and the private key component ('d') when both are provided in an OKP JSON Web Key (JWK). Specifically, the function would parse 'x' but then proceed to construct the private key solely from 'd', effectively ignoring 'x' for validation purposes. This allowed an attacker to craft a JWK with a legitimate user's public key ('x') and an attacker's private key ('d'). When such a JWK was processed by PyJWT, the system would believe it was operating with the legitimate user's key (based on 'x'), but cryptographic operations would actually be performed using the attacker's private key (derived from 'd'). This inconsistency could be exploited in scenarios like DPoP (Demonstration of Proof-of-Possession) to bypass sender-constrained access token protections, as demonstrated in the provided PoC. The patch explicitly adds a check to derive the public key from 'd' and compare it against 'x', raising an InvalidKeyError if they do not match, thereby enforcing consistency.