My front camera is doing the same thing!
I looked into it a bit, and found that this happens when a piece of dust gets into the lens, which steals the focusing of the camera, so it shakes because it oscillates focus from the field of view and the piece of dust. Sadly the camera module needs to be replaced, which can be purchased cheaply but medium tedious difficulty to replace - or pay to have it done not as cheaply.