A Skinful of Shadows by Frances Hardinge
When a creature dies, its spirit can go looking for somewhere to hide. Some people have space inside them, perfect for hiding.
Makepeace, a courageous girl with a mysterious past, defends herself nightly from the ghosts which try to possess her. Then a dreadful event causes her to drop her guard for a moment. And now there’s a ghost inside her.