This sounds like a gall.
On some trees, like on the oaks, you'll find some hollow galls, but there are many types, and galls have been an important source of dye.
I found quite a nice discussion of the types of galls out there and a good variety of the insects that make them. http://www.chemicalecology.net/insects/gallmake.htm
My kids were experimenting with making homemade dyes when they were in the middle school grades, and we tried various things to get a good red. A friend happened to visit during the stage when we had yet another pink cloth come out of the pot of water. She told us that plants weren't as good at making a red dye as insects were, and I think she even mentioned looking for galls. It sounds like you've answered the question my then 12-year-old had about finding galls for dye.