Imam al-Shafi'i (may Allah have mercy on him) said: "The one leading the animal from the front, the one driving it from behind, and the one riding it will be liable for the damage the animal causes with its hand (foreleg), mouth, foot or tail." And he cited the hadith of Sayyiduna al-Bara' bin Azib (may Allah be pleased with him) as evidence for this.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأشربة والحد فيها / Q17688