The invention relates to a cosmetic or dermatological composition comprising, in a cosmetically acceptable medium:(i) one or more compounds chosen from ellagic acid, ethers thereof and ellagic acid salts or ether salts thereof, and(ii) one or more cationic surfactants comprising one or more permanent positive charges.The invention also relates to a cosmetic process for treating keratin materials with this composition, especially for the treatment of dandruff.