As a rule an employee had no right to privacy regarding their salary. That is unless there is an employment contract, union agreement or even company policy that probiits this. So while unprofessional, disclosing your income to a 3rd party is not illegal.