ValueMelody melody-auth through 1.3.8 contains a privilege escalation vulnerability in impersonateUser that allows users with a limited impersonation role to impersonate super_admin accounts. When S2sConfig.impersonationRoles includes a role such as support, attackers can obtain refresh tokens carrying the target's full roles, gaining super_admin control over the authorization server and relying applications.
https://github.com/ValueMelody/melody-auth/issues/554
https://github.com/ValueMelody/melody-auth/commit/cdb239fcbd4a9f95d8e80460d9b14871d6967c5b
https://github.com/ValueMelody/melody-auth/blob/v1.3.8/server/src/handlers/user.ts#L429-L475