Faulty Wiring
If wiring frays anywhere along the path of the light, it can come into contact with the metal parts of the fixture and transfer electricity to your body. If you see frayed wires, have an electrician repair them or remove the fixture yourself.
Bad Solder
Solder holds together some connections within the light fixture, including the socket where the bulbs go. It's possible for solder to have been installed incorrectly, leading to contact with the metal parts of the light. This is a dangerous situation that cannot be fixed, so consider throwing the light away if you suspect defective solder.
Defective Weatherproofing
Some light fixtures that are designed to be outdoors rely on weatherproofing to keep the lights clear of water and risk of electrical shock. If the rubberized or plastic weatherproofing is damaged or defective, it can lead to risk of electric shock from the light fixture.