So, namecoin supports merged mining against bitcoin. My understanding of the merged mining protocol is that basically miners can use the primary coin's POW solution to solve the aux coin's block. It's possible for a primary coin POW solution to not be difficult enough for the primary coin, but be valid for the secondary coin.
However, given this, what would stop a malicious person from working on forging a set of primary blocks, such that they would meet the aux difficulty. They would set their blocks up to be a very high height so they have plenty of time to mine the blocks at the target difficulty (since they don't have enough power to do it in realtime of course). And then, when they need to control of the blockchain, they would submit all of these forged blocks at the proper time, messing up target block times and allowing them to possibly double spend..
How is this prevented?