Or an intermittent ground... Usually, you can pull the RCA plug partly out, breaking the ground while still making the signal connection. If that duplicates the problem, there's the answer.
What does that mean? Wiggling the connections? Which end? I assume you've tried replacing the cables?
Since you said cable
s it's unlikely that both cables would have a broken ground. It might be a broken/intermittent connection inside the sub or receiver.
A ground loop is unlikely to make "massive" hum but an
isolation transformer can isolate the signal ground from the AC power ground. Normally, I'd try to avoid transformers in the audio path but if it eliminates massive hum it would be a massive improvement.
As a temporary ground-loop test you can try a
ground-lift adapter. But that removes the safety-ground and it's not the
intended use of the adapter. The ground is supposed to be connected to the grounded screw attaching the cover plate.