It seems to me that the fact that you received information about the relationship between your son and his friend may be an important point in this story. If the son himself told you, then I think it is worth talking to him about this topic.
If as a result of the conversation it becomes clear that the son does not like the way the other boy treats him, then you can try to talk about why he continues to tolerate such an attitude. It may also be that interaction with such a “friend” is somehow important for your son.
For the sake of preserving this something valuable, the boy is ready to tolerate such an attitude.
Unfortunately, you did not indicate the age of your son, but in any case, a child of any age can be explained how to proceed in this situation by resorting to generally accepted and working methods.
If your son is satisfied with everything, he does not see the problem, then it may be worth talking to him about the fact that such a relationship with another person is not accepted in our society, i.e. to help him understand what can be considered an acceptable form of behavior, and what should be stopped. Here, your task, I think, is also to explain and discuss with the child how to change things for the better.
It is a different matter if you find out about what is happening from other people, not from your son. Here, first of all, it is worth making sure that everything is exactly as described to you. How to act if the situation is really like that?
It is possible to use the previous recommendations – find out how your son relates to what is happening, and decide what to do next.
If the information is not true, then no action is required.