V.F.
I have my oldest, a 7 year old who is also like that. We had some contractor over and she had to hug him good bye. Before I realized it, it was over. He smiled and said it was ok bc he had children. I have learned with mine, she just stays right by me. I tell her that people need space, and not everyone likes to be hugged. I tell her that we usually reserve hugs for people we know. She still does this, but it has gotten better. Another thing I tell her is that some people are not always nice and that never to walk away from me or get into cars with strangers. I have told her that if someone took her, they may not be nice to her, like we are. Then I say they may make you eat foods you don't like, or may not let you watch tv or... That may sound a little crazy, but when it comes to the kids, I just would rather be safe than sorry.
Good luck, sounds like you have a sweet little girl!