Aims: We derive the dense core structure and the water abundance in four massive star-forming regions in the hope of understanding the earliest stages of massive star formation.
Methods: We present Herschel/HIFI observations of the para-H2O 111-000 and 202-111 and the para-H_218O 111-000 transitions. The envelope contribution to the line profiles is separated from contributions by outflows and foreground clouds. The envelope contribution is modeled with Monte-Carlo radiative transfer codes for dust and molecular lines (MC3D and RATRAN), and the water abundance and the turbulent velocity width as free parameters.
Results: While the outflows are mostly seen in emission in high-J lines, envelopes are seen in absorption in ground-state lines, which are almost saturated. The derived water abundances range from 5×10-10 to 4×10-8 in the outer envelopes. We detect cold clouds surrounding the protostar envelope, thanks to the very high quality of the Herschel/HIFI data and the unique ability of water to probe them. Several foreground clouds are also detected along the line of sight.
Conclusions: The low H2O abundances in massive dense cores are in accordance with the expectation that high densities and low temperatures lead to freeze-out of water on dust grains. The spread in abundance values is not clearly linked to physical properties of the sources.

