I suppose I could move the comma: "What, are you stupid?"
One version sets an expectation for a classification (what) and then asks if the person meets a specific condition (are you stupid?).
The other suggests a mystery (what are you?) and then suggests a possible response (stupid).
Slight variations in meaning, but pretty much the same implication.
But I think we'll all agree that the comma is necessary; the only option is where you put it.
And please note, for those of you who might not have noticed, that I'm replying to a reply ranting about stupidity -- I'm not actually calling the poster "stupid," I'm playing off his response to the rant about stupidity, saying he wasn't clear about what the original ranter was saying. It's actually meant to be a joke, but if I have to go into this much detail explaining it, that just squeezes all the funny out of it.