Earlier quoted context omitted.
It is now illegal for employers to ask about past salary: [first article I googled] https://www.thepennyhoarder.com/make-money/salary-history-la...
I'm not sure how laws like that help if an employer has access to information about past salary so they don't have to ask. There is an Equifax service that keeps track of past jobs to some extent. It isn't necessarily accurate or complete, but it exists - https://www.theworknumber.com/
(b) An employer shall not, orally or in writing, personally or through an agent, seek salary history information, including compensation and benefits, about an applicant for employment