The vulnerability lies in the session token generation mechanism of xxl-job. The core of the issue is the makeToken function within the now-removed LoginService.java. This function created an authentication token by serializing the entire user object (including role and permissions) into a JSON string and then encoding it into a hexadecimal string. This is not a form of encryption or secure hashing; it's a simple, reversible encoding.
The parseToken function in the same file demonstrates this reversibility, decoding the hex string back into the original user object. An attacker could exploit this by crafting a JSON object for a privileged user (e.g., an administrator), encoding it using the same method, and submitting the resulting token to gain unauthorized access. The login and ifLogin functions within LoginService were responsible for creating and validating these insecure tokens, respectively. The patch addresses this by completely removing the vulnerable LoginService and replacing the authentication mechanism with xxl-sso, which uses randomly generated UUIDs for session tokens, a standard and secure practice.