A composition that is self-foaming in an acid medium, and includes: at least one hydrophilic polymer, at least one compound capable of crosslinking the hydrophilic polymer by forming ionic bonds, at least one foaming agent, and at least one foam stabilizer agent; and to the use thereof as a drug, particularly for preventing and/or treating obesity.