It would be from the front of the light since in a well designed light there either wouldn’t be any other place for it to come in or if the light is made of several pieces (and could theoretically leak) it doesn’t with any kind of reasonable o-ring design.
So, it’s the switch (but this isn’t an issue with a well designed dive light due to the kind of switch chosen) or it’s front water pressure against the front lens letting water get behind the lens due to a bad o-ring design in the head.
Typically, a good design is a groove in the head on a ledge which you drop in an o-ring so as pressure (on the front glass increases) the o-ring has no where to go and compresses to counteract the forces pressing against it.
Therefore, the deeper you go the more pressure against the front lens the more the o-ring compresses and … no leaking.
Many backup dive lights are made of only two parts…a body and a screw-on head (and front lens of course). So there is no switch to leak.
You fully screw the head in to turn the light on and slightly unscrew it to break contact and turn the light off. In this design you have a long section of threads connecting the head to the body with thick o-rings (sometimes 2 although multiple o-rings isn’t necessarily better).
The best backup dive light I have is made of Delrin for the body and metal for the head. The lens is 6mm thick and the head diameter is only about 30mm.
This light is a tank in effect. It’s the Ultrafire W300 from DX and it’s $36 using 3 AA’s and a XP-E (XR-E?). It’s a nice, tightly focused light. Since it uses primary batteries you don’t have to remember to charge it so it’s alway ready (it’s a backup after all).
I clip it to my shoulder strap and have a small bungee around the head as well so I forget that I even have it on.
For a primary light I use rechargeable batteries (18650) and two are needed IMO since a typical dive is close to an hour and it’s not uncommon to do two dives back to back.
For a primary dive light I’d like for it to have a magnetic switch. The one thing to tells me that most Chinese lights aren’t really designed by a diver is that many of them still have crenelated bezels which are totally useless (and a hazard) on a dive light.
Sharp edged heat fins are a nuisance as well and aren’t needed since the light is being used in water. Frequently the front glass lens isn’t as thick as one would prefer for a dive light.
This is all basic stuff so for the manufacturer to not realize this means that no one has a clue about diving.