Safely use a bare light socket
You are right to be concerned about safety. Attempting to use the sockets as they are is a  hazard, the exposed conductors are an electrical and safety concern. What you have is a replacement part for repairing a damaged fixture.