Cobras can attack through walls.
To recreate this, simply create a 2x2 box. Lure a cobra inside the box. Then stand near the box.
I've had an alpha cobra kill a tame through my base wall. When I went to kill it, it then killed me through the wall.
It's also happened when I made a taming box for a rhino. It agro'd it while the rhino was completely enclosed, went in through the ramp/roof killed the rhino then killed me while I was standing on a ceiling 1 square above it.