Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Switch anonymous user ID hash from md5 to shake (openedx#26198)
Now that we always return an existing value from the DB rather than trusting that ID generation is deterministic and constant over time, we're free to change the generation algorithm. Our long term goal is to switch to random IDs, but we need to first investigate the uses of save=False. In the meantime, this is a good opportunity to move away from MD5, which has a number of cryptographic weaknesses. None of the known vulnerabilities are considered exploitable in this location, given the limited ability to control the input to the hash, but we should generally be moving away from it everywhere for consistency. This change should not be breaking even for save=False callers, since those calls are extremely rare (1 in 100,000) and should only occur after a save=True call, at which point they'll use the stored value. Even if this were not true, for a save=False/True pair of calls to result in a mismatch in output, the first of the calls would have to occur around the time of the deploy of this code. Co-authored-by: Tim McCormack <tmccormack@edx.org> Co-authored-by: Tim McCormack <tmccormack@edx.org>
- Loading branch information