Is this a hypothetical question? If you are thinking of getting a German Shepherd and are just curious about this situation I can tell you that normally German Shepherds will not get "aggressive" towards a stranger without being threatened or feeling threatened first.
If you are thinking of getting a GSD I would highly suggest dog obedience training classes at a minimum and loads of socialization to prevent just this situation. This can't be stressed enough. I hope this answers your question.