You are correct that a 7‑segment display contains seven LEDs (plus the decimal point, making eight). However, these LEDs are driven in a high‑speed multiplexed fashion – only one segment is lit at a time, but they cycle so quickly that they appear to be all on simultaneously.
Because only one LED is actually active at any given moment, a single resistor on the common cathode or anode line is sufficient to limit the current for that one active LED.
That said, it is also common practice to put a resistor on each anode pin for added safety and to ensure consistent brightness across segments. Both approaches work – the single‑resistor method is simpler and still safe for this multiplexed setup.