Milsom has made 15 appearances for the Dons and netted his first goal in the 3-2 loss to St Mirren earlier this month.
Manager Craig Brown said: "We are very pleased that Rob Milsom has signed a contract to stay with the club.
"That is excellent for Aberdeen Football Club and he has made a good impact since he has come to the club.
"All the correspondence and information I get from the fans is that he is a very popular player here. (He is) certainly very popular in the dressing room and with the staff so we are delighted about that signing.
"There was interest from other SPL clubs so we are very, very pleased to have managed to get Rob signed at Aberdeen."