Special relativity only applies locally. Wormholes allow superluminal (faster-than-light) travel by ensuring that the speed of light is not exceeded locally at any time. While traveling through a wormhole, subluminal (slower-than-light) speeds are used. If two points are connected by a wormhole, the time taken to traverse it would be less than the time it would take a light beam to make the journey if it took a path through the space outside the wormhole. However, a light beam traveling through the wormhole would always beat the traveler. As an analogy, running around to the opposite side of a mountain at maximum speed may take longer than walking through a tunnel crossing it. You can walk slowly while reaching your destination more quickly because the distance is smaller.