The present invention relates to a cosmetic composition comprising at least one cationic polymer and/or one amphoteric polymer and at least 3% of one or more dicarbonyl compounds corresponding to formula (I) below and/or hydrates thereof and/or salts thereof, in which formula (I), R=H, COOH, linear or branched C1-C6 alkyl optionally substituted with an OH or COOH or Br radical; phenyl or benzyl optionally substituted with an OH or COOH radical; or alternatively an indolyl radical or formula (A). The invention also relates to a process for straightening keratin fibres, especially the hair, which comprises the application to the hair of the composition of the invention, followed by a straightening step using a straightening iron at a temperature of at least 150° C., preferably ranging from 150 to 250° C.