The vibrational anomalies of glasses, in particular the boson peak, are addressed from the standpoint of heterogeneous elasticity, namely the spatial fluctuations of elastic constants caused by the structural disorder of the amorphous materials. In the first part of this review article a mathematical analogy between diffusive motion in a disordered environment and a scalar simplification of vibrational motion under the same condition is emploited. We demonstrate that the disorder-induced long-time tails of diffusion correspond to the Rayleigh scattering law in the vibrational system and that the cross-over from normal to anomalous diffusion corresponds to the boson peak. The anomalous motion arises as soon as the disorder-induced self-energy exceeds the frequency-independent diffusivity/elasticity. For this model a variational scheme is emploited for deriving two mean-field theories of disorder, the self-consistent Born approximation (SCBA) and coherent-potential approximation (CPA). The former applies if the fluctuations are weak and Gaussian, the latter applies for stronger and non-Gaussian fluctuations. In the second part the vectorial theory of heterogenous elasticity is presented and solved in SCBA and CPA, introduced for the scalar model. Both approaches predict and explain the boson-peak and the associated anomalies, namely a dip in the acoustic phase velocity and a characteristic strong increase of the acoustic attenuation below the boson peak. Explicit expressions for the density of states and the inelastic Raman, neutron and X-ray scattering laws are given. Recent conflicting ways of explaining the boson-peak anomalies are discussed.