By shooting the arrows when you are riding the dragon, the arrows seemd to be reflected by the edges of dragon's hitbox and then deal 1 damage on yourself (dragon itself not getting hurt).
I'm now using 1.7.10 build together with Aether Legacy mod, so if this bug is fixed in newer versions, consider rebuilding a 1.7.10 version.
As I find that the hatched dragon's hitbox is a cube much smaller than original dragon's cuboid hitbox. (even at 10.2, with f3+b I can get this). When riding, the hitbox of player is just above the dragon's hitbox but the arrows are generated inside and get stuck, meanwhile hurting yourself.