A massive stellar flare on a baby star has been spotted by astronomers, shedding light on the origins of potentially habitable exoplanets.