That's a Mini Baba. It won't attack
Mini Babas are sprouts of Deku Babas that can be found in Southern Swamp and several holes across Termina. These pre-mature Deku Babas are just heads that stick out of the ground. The only way they harm Link is if he walks over them. Simply attack it with the Sword and it will be defeated. They leave behind a Deku Nut every time they are defeated, so they are great for stocking up on them, since they often re-appear after a few moments.
Mini Baba from Majora's Mask.