Who wrote the commentary on Sanhedrin attributed to Rashi? Here is what I wrote elsewhere:
The first to question the authorship of the commentary on Sanhedrin chapter Chelek (chapter 11 in the Gemara, 10 in the Mishnah) was R' Nosson Nota Rabinowitz in his Dikdukei Sofrim. He noted that the usage of language indicated that the commentary was not written by Rashi. However, since R' Meir HaLevy Abulafia in his Yad Ramah attributed the commentary to Rashi, R' Rabinowitz accepted this claim. Later scholars have debated the topic at greater length and not arrived at any convincing conclusion. R' Ya'akov Nachum HaLevy Epstein, a noted academic scholar, wrote a long article in which he brought strong proofs that Rashi did not write the commentary. Prof. Saul Lieberman has tried to recreate parts of Rashi's real commentary based on medieval Christian writings. However, the evidence points in both directions and no one has yet been able to conclude the debate. It still remains unclear who wrote the commentary on Chelek attributed to Rashi.attached document (PDF)
In the attached document are the following:
1. The comments of Dikdukei Sofrim questioning the authorship.
2. The introduction to Sanhedri Gedolah discussing the issue.
3. R' Menachem Kasher's notes on the issue in his monumental bibliographical work Sarei HaElef.
UPDATE: Thanks to two commenters who directed me to Yonah Frenkel's Darko Shel Rashi Be-Ferusho La-Talmud Ha-Bavli and Prof. Shamma Friedman's essay in Z.A. Steinfeld ed., Rashi, Iyunim Bi-Yetziraso. Frenkel devotes chapter 10 of his book to the sources of Rashi's commentary to Perek Helek. He concludes that there are three levels -- Rashi's own, Rashi's students and later additions. Interestingly, on page 316 he writes that the Rashi used by Lubavitcher messianists (Sanhedrin 98b sv i min haya) is not a later addition.
Prof. Friedman disagrees with Frenkel. The English summary of Friedman's article states this (p. XLII):
Thus the recension of Rashi's commentary to Heleq (Sanhedrin XI) may be ascribed to a disciple, but the content must be attributed largely to Rashi.