The attachment-line boundary layer is critical in hypersonic flows because of its significant impact on heat transfer and aerodynamic performance. In this study, high-fidelity numerical simulations are conducted to analyse the subcritical roughness-induced laminar–turbulent transition at the leading-edge attachment-line boundary layer of a blunt swept body under hypersonic conditions. This simulation represents a significant advancement by successfully reproducing the complete leading-edge contamination process induced by a surface roughness element in a realistic configuration, thereby providing previously unattainable insights. Two roughness elements of different heights are examined. For the lower-height roughness element, additional unsteady perturbations are required to trigger a transition in the wake, suggesting that the flow field around the roughness element acts as a perturbation amplifier for upstream perturbations. Conversely, a higher roughness element can independently induce the transition. A low-frequency absolute instability is detected behind the roughness, leading to the formation of streaks. The secondary instabilities of these streaks are identified as the direct cause of the final transition.