The World Federation One Stop Fiqh

Ruling 1076

It is unlawful to perform sajdah for any being other than Allah the Exalted. Some people place their forehead on the ground in front of the graves of the Infallible Imams (ʿA); if they do this for offering thanks to Allah the Exalted, there is no problem; otherwise, it is problematic [i.e. based on obligatory precaution, it must not be done].