Yes, cardboard boxes and paper bags do attract cockroaches, for two reasons. First, cardboard is a food source for roaches, and second, it also provides a nice dark and warm place for a roach to hide and live.
A roaches existence is consumed with the search for food, water, and shelter. If you eliminate those resources from your home, roaches will have no reason to come there.
Cockroaches are omnivorous and will eat just about anything. Cardboard is of course made out of paper, and paper is made out of trees. That means cardboard is an organic material and can be consumed as a food source, even though we humans wouldn’t consider it as such.
Roaches are especially attracted to old, rotting, and wet cardboard because not only is it a food source but it is also a source of water. The smell of wet cardboard is delightful to a roach.
If you have a roach infestation in your house, perhaps in the attic or storage room there are cardboard boxes used as storage containers. If so, get rid of them and replace them with plastic storage containers or something else made from inorganic compounds that roaches can’t use as a food source.