The vulnerability lies in the exposure of an HMAC secret key used for verifying the integrity of serialized Python objects stored in S3. The root cause is that the secret key was stored as an environment variable (REMOTE_FUNCTION_SECRET_KEY) within the SageMaker training job. This environment variable is visible to anyone with DescribeTrainingJob API permissions.
The patches address this by removing the HMAC-based integrity check entirely. The hmac_key parameter was removed from all serialization and deserialization functions, and the key is no longer generated or stored in the job's environment variables. Instead of HMAC-SHA256, the new implementation uses a simple SHA256 hash of the payload for the integrity check, which does not rely on a secret key.
The primary vulnerable functions are those responsible for deserialization (deserialize_obj_from_s3, deserialize_func_from_s3), as they are the entry point for remote code execution if an attacker can provide a malicious object signed with the compromised key. The functions that expose the key (_Job.from_describe_response) or set the key in the environment (_JobSettings.__init__, _Job.compile) are the enablers of this vulnerability.