Electrocution is always a possibility when electrical wiring has holes or cuts in the lines. The protective coating prevents items from being electrocuted when in contact with the bare wire. Thankfully, there is a fairly simple way to reduce this possibility and repair the wiring.
Turn off the breaker in the electrical panel that corresponds with the area the wire is in. Then using electrical tape, tightly wrap the exposed wire completely covering any bare metal. This temporary fix can help keep the area safe until you can properly repair the wire. Remember that tape adhesive loses its stickiness over time. A professional electrician will either run a new wire or replace the exposed section with a new wire connected to the existing wire with wire nuts.