The vulnerability is an uncontrolled resource consumption (CWE-400) issue in joserfc. The compact JWS/JWE deserialization functions call value.split(b".") on attacker-controlled input before validating the input size. Python's bytes.split() copies each segment, so an oversized input causes an additional attacker-sized allocation before the library's size guard (ExceededSizeError) is triggered.
The fix (commit 397e04f4bbce0b94d86e31c1c003f4640af8fb39) adds a new validate_compact_value_size() method to both JWSRegistry and JWERegistry, and calls it BEFORE value.split(b".") in the two deserialization functions:
extract_rfc7515_compact in src/joserfc/_rfc7797/compact.py (JWS compact serialization)
extract_compact in src/joserfc/_rfc7516/compact.py (JWE compact serialization)
The vulnerable functions are these two deserialization functions, which previously performed the split() before any size check. The newly added validate_compact_value_size methods are the mitigation (not vulnerable functions), and the validate_header_size/validate_payload_size/validate_signature_size methods already existed but were only reached after the split had already allocated memory.
Note: The deserialize_compact() function mentioned in the advisory is the public API entry point that ultimately calls extract_rfc7515_compact, but the actual vulnerable code (the split() before validation) lives in extract_rfc7515_compact and extract_compact.