In a perfect world, with perfect electronics, there would be no need for a grounding conductor. It's there to deal with imperfections. The most likely case for a ground fault in this installation would be if the black conductor lost some insulation and shorted itself against the frame of the fan. In such a situation, the casing could become electrified, and a grounded person, touching the fan body could receive a shock.
If it were properly grounded, you'd get a short circuit to the ground wire, and the breaker would trip.
However, the fan is mounted to the ceiling, and the possibility of someone touching it is low. (Unlike, for example, the frame of a fridge or stove, where human contact is part of normal operation.)
So, Is it safe? Quite likely. For added safety, turn the wall switch off when changing bulbs. Is it to code? No. -- Unless, as others have suggested in comments, the mounting box is grounded on the other side.
You can however, locate the breaker, and replace it with a Ground Fault Interrupt breaker, which would trip should a ground fault occur. This isn't something you should do yourself unless you have experience working in the panel.
Another possibility, if your switch happens to be chained off of an outlet, which is quite possible, depending on the routing of the wiring on that circuit, is to replace the outlet with a GFCI outlet, and wire the switch to the load side of it.
If your box is that small it is almost certain that it is not a fan rated box. If it is not, then the box MUST be replaced with a fan rated box.
Sorry, but even with approval, someone unlicensed, uninsured, and unqualified SHOULD NOT be doing electrical work in a place that they rent.
This is a perfect example; something as "simple" as changing a ceiling fan turns into a project since the box has to be replaced, and in an older house this can be met with issues.
Best Answer
Mount the fan to the joist or block behind the box, not the box
The two screws in the back of the box in line with the mounting tabs appear to land in a joist or cross-block in the ceiling. I would attach the fan to that using two 1/4" by 3" structural wood screws (not drywall, deck, or lag screws -- look for something with an ICC-ES or IAPMO rating, such as a FastenMaster TimberLok or Simpson Strong-Drive SDS) through the fan bracket and ceiling finish board into the structural member.