On 17 September 2017, Carvajal's contract was extended until 2022. Early in the following month, he was sidelined with a heart condition; he made eight appearances during that year's Champions League, and Madrid won their third consecutive and 13th overall title in the competition. In the decisive match against Liverpool he was forced to leave the pitch due to an injury, in an eventual 3–1 win in Kiev.