Answer
It does not violate the first law of thermodynamics.
It necessarily violates the second law of thermodynamics.
Work Step by Step
According to the first law of thermodynamics, energy cannot be created or destroyed. The amount of heat leaving the cold object is the amount of heat entering the hot object. Here, energy is neither created nor destroyed. Thus, it does not violate the first law of thermodynamics.
Here, heat spontaneously flows from the cold to the hot object without any external work input. This directly violates the refrigerator statement of the second law of thermodynamics, according to which it is not possible for heat to go spontaneously from a cold to a hot object without any external work input.