As I understand it, NM cable is not supposed to be outside at all. But there seems to be a bit of a debate as to whether "box attached directly to an outside wall" counts as outside (need to change to different cabling inside before going through the wall) or not.
Since it was previously installed this way, I would leave it as is. Which means installing a new light fixture and/or box + light fixture but not changing the cable. Some light fixtures include an integral junction box. However, here you need a box both for connecting the wires and for connecting to the wall. Depending on the particular fixture, it may be possible to attach the fixture directly to the wall and use an integral junction box to connect the wires. Or the fixture may be designed to attach to a junction box and not directly to the wall, in which case you install an appropriate metal box to the wall and then attach the fixture to the box.
The wiring does look a little strange. There appears to be black, white and bare ground from a cable and also a second cable (end not visible). What is that second cable for?