This question relates to a comment on a question I posted at https://askubuntu.com/questions/1426688/sudo-with-a-userid-reverting-old-behaviour?noredirect=1#comment2484447_1426688
Specifically, in Ubuntu 18.04 I could run a command like "sudo -u #2000 command" where user 2000 is not in the passwd file, but that does not work on Ubuntu 20.04 or 22.04. The first comment - by a well reputed user - says that this is a security hole, but does not give any reference, and I have subsequently found the man page (which I accept could be out of date) appears to contradict this.
Is/was there a security hole that has changed the operation of sudo in this respect? (I'm aware that there was a bug related to using #-1 which was fixed (I think CVE-2019-14287), but I'm not sure if this relates to that - it does not seem to).
Relatedly, assuming that I'm issuing the command as root so I can reduce my privileges are there any security related concerns with this behaviour? (I would assume not, as I already had root to begin with), but maybe I'm missing something?