They are allowed, by law, to ask for the number. That’s the opppsite of “unlawful.” Words means things.
20 CFR 3 A7 404.1905
31 CFR 103.34(a)(1)
26 CFR 301.6109-1(c)