No electrical boxes in the ceiling
I have been slowly trying to go through my house and change out old brass fixtures in my 19 year old house to more updated fixtures and keep coming across the same problem: simply a black and a white wire poking out a one inch diameter hole in the ceiling with no blue electrical box (or as I call it a "blue cup") to attach the new fixture to. I'm not sure they haven't simply drilled holes into the drywall to attach the old fixture to the ceiling. (It looks thicker than just 1.5- 2" but not sure if it includes a stud or what). In the master bath, there is simply a tear in the drywall with wires poking out that was covered by the lighting strip type fixture.
Is it safe to simply attach the fixture to the ceiling? (The ceiling fan I took down has obviously been there for a while without falling.) Or is a must to install an electrical box, and if so, is that something I can figure out on my own or best left to the professionals?