Unfortunately, it is completely legal, unless there was some confidentiality or nondisclosure agreement in place between you and the prospective employer; or alternately, IF the prospective employer had, prior to you applying or sending the materials, promised that it would not be shared with your current employer, and the reason you sent the prospective employer your resume, etc., was because of that explicit promise. In these two cases, you may be due compensation for the breach of confidence. However, without one of the two above-described situations, a prospective employer is free to share your resume and cover letter with whomever it would like: current boss, other possible employers, the local news...anyone. This is what makes applying for a new job while still employed somewhat risky.