“Bookworm” is a misnomer. The creatures that damage books are beetle larvae (e.g., Anobium punctatum — common furniture beetle), not worms.
Insect larvae typically have six legs (three pairs) — but they’re not “six‑legged bookworms” as a distinct category. Most insects have six legs in larval and adult stages. The term “bookworm” colloquially covers several beetle species whose larvae bore into paper and bindings.
Prevention: control humidity, temperature, and cleanliness; freeze infested volumes.