I had this for a while mostly on my left hand. I pretty much woke up with the middle and ring fingers of my left hand stuck straight. The fingers on my right hand started acting up too. It hurt to bend them and they felt so arthritic. I thought I was supposed to feel pregnant, not old.
I squeezed a stress ball at work to give my hands and fingers a workout. At home, I did the same and continued to wiggle and flex them whenever I was relaxing. I haven't had this problem in a few weeks, so either the exercises worked or it just faded away.