I was frying onions and garlic the other day and the paste turned green. I had bought the onions/garlics many days ago (20-30 days) I guess. Could that be the reason? There was no fungi or something suspicious when I cut them by the way.
I've also had this happen when cooking an onion-garlic paste. I've found several web pages where the phenomenon is discussed, listed below. In summary, it's normal and happens due to certain chemical reactions between the garlic, cooking utensils and water. In your case, it's probably not due to the age of your garlic or onions though, as one source suggests it is less likely to occur with aged garlic. I've only seen the paste turn green myself, though interestingly you could also get blue garlic:
Some other pages where this is discussed: http://chowhound.chow.com/topics/471608, http://www.cheftalk.com/forum/thread/45254/onions-turned-green-while-frying, http://whatscookingamerica.net/Q-A/bluegarlic.htm.