Context : The expanding magnetic flux in coronal mass ejections ( CMEs ) often forms a cavity . Studies of CME cavities have so far been limited to the pre-event configuration or to evolved CMEs at large heights , and to two-dimensional imaging data . Aims : Quantitative analysis of three-dimensional cavity evolution at CME onset can reveal information that is relevant to the genesis of the eruption . Methods : A spherical model is simultaneously fit to Solar Terrestrial Relations Observatory ( STEREO ) Extreme Ultraviolet Imager ( EUVI ) and Inner Coronagraph ( COR1 ) data of an impulsively accelerated CME on 25 March 2008 , which displays a well-defined extreme ultraviolet ( EUV ) and white-light cavity of nearly circular shape already at low heights h \approx 0.2 R _ { \odot } . The center height h ( t ) and radial expansion r ( t ) of the cavity are obtained in the whole height range of the main acceleration . We interpret them as the axis height and as a quantity proportional to the minor radius of a flux rope , respectively . Results : The three-dimensional expansion of the CME exhibits two phases in the course of its main upward acceleration . From the first h and r data points , taken shortly after the onset of the main acceleration , the erupting flux shows an overexpansion compared to its rise , as expressed by the decrease of the aspect ratio from \kappa = h / r \approx 3 to \kappa \approx ( 1.5 \mbox { - - } 2 ) . This phase is approximately coincident with the impulsive rise of the acceleration and is followed by a phase of very gradual change of the aspect ratio ( a nearly self-similar expansion ) toward \kappa \sim 2.5 at h \sim 10 R _ { \odot } . The initial overexpansion of the CME cavity can be caused by flux conservation around a rising flux rope of decreasing axial current and by the addition of flux to a growing , or even newly forming , flux rope by magnetic reconnection . Further analysis will be required to decide which of these contributions is dominant . The data also suggest that the horizontal component of the impulsive cavity expansion ( parallel to the solar surface ) triggers the associated EUV wave , which subsequently detaches from the CME volume . Conclusions :