Exposed splices are a fire safety or shock concern, but can be made safe by placing the splices in a J-Box or in the the fixture if designed for splices. This can generally be done easily and quickly.
Wires spliced together and not in a J-box, may become hazardous; in example, if the wire nuts were to come loose, you might end up with exposed hot wires, which can arc.
If No Junction Box
Installing a J box (junction box) is vary easy and the boxes are inexpensive. Remember, that when running the wires into the J-box, that there should be a wire clamp holding the wires where they enter into the box.
This does two things. One, it keeps the insulation of the wire from being damaged by the metal edge of the box. Two, it helps prevent the wires from being pulled loose, should someone accidentally pull on the wire, thus causing the wires to become un-attached.
Cover missing from the junction box
At times, the reason the splices are exposed, is that the cover to the junction box is not on it. If the cover is out of place, then just shifted it back into position and tightened it back down. If the cover is missing, stop by the local hardware store or home center and pick up a cover for the box. They’re very inexpensive.