"And Joseph brought a bad report of them" (Genesis 37:2). What is the meaning of "a bad report of them"? That he spoke slander (lashon ha-ra) about his brothers. And what slander did he speak about them? Rabbi Judah said: He said about them that they would cut off a limb from a living animal and eat it. The Holy One, blessed be He, said to him: You spoke slander about the tribes. By your life, tomorrow you will go down to Egypt, and you will invite them to eat with you, and they will suspect you there concerning the slaughtering, as it is said, "And they set on for him by himself" (Genesis 43:32). Rabbi Meir says: He said to him that his brothers set their eyes upon Canaanite women. The Holy One, blessed be He, said to him: You spoke slander about your brothers. By your life, tomorrow you will go down to Egypt, and she will say, "The Hebrew slave came in to me" (Genesis 39:17). Thus, "And Joseph brought" etc.
Joseph's Slander of His Brothers and Its Measure-for-Measure Punishment
Midrash Tanchuma Buber, Vayeshev 6:1
ויבא יוסף את דבתם רעה, מהו את דבתם רעה, שאמר לשון הרע על אחיו, ומה לשון הרע אמר עליהם, אמר ר' יהודה אמר עליהם שחותכין אבר מן החי ואוכלין, א"ל הקב"ה אתה אמרת לשון הרע על השבטים, חייך למחר אתה יורד למצרים ואת קורא להם שיאכלו עמך, והם חושדים אותך שם על השחיטה, שנאמר וישימו לו לבדו וגו' (בראשית מג לב), ר' מאיר אומר א"ל אחיי נותנין עיניהן בכנעניות, א"ל הקב"ה אמרת אתה לשון הרע על אחיך, חייך למחר אתה יורד למצרים, והיא אומרת בא אלי העבד העברי (שם לט יז), הוי ויבא יוסף וגו'.