The present invention relates to a composition including at least one C7 sugar, or derivative from esterification of said sugar, and a pharmaceutically acceptable carrier for treating alopecia. The present invention also relates to a method for cosmetically treating hair and nails, said method being intended to stimulate the growth thereof and/or slow the loss thereof. According to said method, a cosmetic composition including at least one C7 sugar, or derivative from esterification of said sugar, is administered. The present invention finally relates to a method for cosmetic care of hair and/or eyelashes and/or nails.