My 9 yo is like that. Everyone is his friend. People he doesn't know are just friends he hasn't met.
Lindsay is starting to act like that but she is not as friendly and doesn't hesitate to tell people that she wasn't talking to them or that they are upsetting her and come running back to me.
What I do is talk to them about how its okay to be friendly but they don't know these people. You don't share secrets with them. I put it in the framework of being pushy if you try to force these people to talk to you and that sometimes that is what you are doing if you do anything more than smile and say hello. My son has lots of friends his own age, so when he started school we had a talk about how he can not go with anyone unless I or his teacher tells him that it is okay. When he was in 2nd grade we talked about who had premission to take him out of school without him being told. He could not leave school grounds with anyone but the grownups from 3 different families. Anyone else he was to say, I need to talk to my mom first. Anyone I would send for him would have my cell phone number and could get a hold of me or his dad so there would be no reason for anyone else to pick him up.
With Lindsay we've talked a little bit more about how you don't know these people and that anyone could be pretending to be someone they are not. She isn't going to go off with someone because that isn't her personality. She's loud and very vocal. We taught both kids that if someone does try to take them they are to yell "Help! This is not my mommy!Let me go!" "Help! This is not my daddy! Let me go!" over and over. We've talked about who to go to for help if they get lost or separated from us. Which adults you should ask help from. Dh walked them through a what if you get lost at the store scenerio last week because we had gone some place that was very crowded and they were getting frustrated about having to stand by us, holding our hands.
I don't know what else we can do, because this is just their personalities and its what makes them special.