Cosmoline (really just less refined Vaseline) has been used since before WWII to store weapons for extended periods, and it works very well, but it hardens after a few years and is a pain to remove.
Non-viscous oils keep spreading out and eventually leave the metal because of gravity (the reason they use a viscous one). That takes years, but it happens. If you're talking about a few years then there's nothing wrong with petroleum based products, or even motor oil. As long as it creates a film, long enough, it certainly won't damage the metal, though it can break down wood over time.
If you want to store for longer periods you may want to look at Renaissance Wax. It isn't specifically a "gun product", but it's been around the museum community for decades. It's crystalline based and 100% non-reactive. It's so gentle they even use it on wood and old photographs to preserve them. Most paste wax was has chemicals in it that are reactive, but this one doesn't. It's on most of the firearms in museum collections (including the Smithsonian's firearm collection), and I've read more than one article written by firearms curators extoling it's virtues and lack of maintenance. It goes on in a paste (just like car wax) and buffs to perfectly clear coating and creates an invisible barrier that you don't need to ever take off or worry about. Once it's on it never comes off unless it's rubbed off. It's better not to excessively handle the firearms once you've applied it, but you wouldn't even know it's on there.
My father used it on our collection, and I'm using the same can of the stuff decades later. One little can of it will coat hundreds of guns and probably last your lifetime. Unless you are storing specifically in a zero humidity, climate controlled environment, or only temporarily, I highly recommend trying this stuff. You will not be disappointed, and when you're ready to use your guns again just hit them with whatever lube you want and shoot. It may work too well in certain circumstances, as I've heard it completely arrests the patina forming on old Colts and Winchesters. Once coated they look like they are stuck in time.