He refers certainly to the prophet () as he knows better whether they are regarded equal or not.
For an explanation:
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said:
That is, (they are all the same) in terms of being cursed, because they co-operated in that.
End quote from Fataawa Noor ‘ala ad-Darb, 16/2 (Source: islamqa #202904)
And for a backup that it is the prophet who say this a quote from Mirqat al-Mafatih the commentary on Mishkat al-Masabih -see here-:
( وقال ) ، أي : النبي - صلى الله عليه وسلم
(and he said): meaning: the prophet Allah's prayer and blessing be upon him.