High-intensity lasers can be used to generate shockwaves, which have found applications in nuclear fusion, proton imaging, cancer therapies and materials science. Collisionless electrostatic shocks are one type of shockwave widely studied for applications involving ion acceleration. Here we show a novel mechanism for collisionless electrostatic shocks to heat small amounts of solid density matter to temperatures of ∼keV in tens of femtoseconds. Unusually, electrons play no direct role in the heating and it is the ions that determine the heating rate. Ions are heated due to an interplay between the electric field of the shock, the local density increase during the passage of the shock and collisions between different species of ion. In simulations, these factors combine to produce rapid, localized heating of the lighter ion species. Although the heated volume is modest, this would be one of the fastest heating mechanisms discovered if demonstrated in the laboratory.