Are you kidding? This happens to me constantly, and it has since day one! I thought for sure somebody would have posted about this by now!
Duplicating it is really simple, as is turning it off. To start it:
1. Press and hold down a directional key (arrow or num).
2. Press and hold Shift.
3. Release directional key.
Testing reveals that this does not happen if you pressed Shift before the directional key.
Voila, the cursor (or camera) is moving on its own. It honestly felt like a really annoying feature to me when I first learned how to duplicate it. It continues when you release Shift.
To fix it:
1. Press and hold the direction opposite the cursor's movement. The cursor should shake back and forth.
2. Press the direction it was moving, and release both keys. Now the cursor should stop.
If that doesn't fix it, then you need to follow the steps above for making it happen again in the same direction, then perform the steps for the fix again. More often than not, you will need to force it to happen in the same direction before the fix works.
Be careful, as it's possible to stack this glitch. I've had the cursor shake rapidly between two squares because I had it going in two directions at once, and I've even had it going in a 2x2 circle by stacking four at once. Each one can be turned on with a separate application of direction+shift+release direction, then performing the fix. Before learning this, I've actually been forced to save and exit the application because I didn't know how to make it stop, but since it happens to me practically every time I use shift I've gotten used to it.