I could argue that Starfleet could simply issue a warning about this specific ship (as identified by her transponder codes) not being legit. And if the foe is capable of forging transponder codes, then the actual ship he flies is more or less a triviality.
Then again, Starfleet isn't famous of keeping close track of its vessels. Ships with assignments into the deep unknown may be quite out of touch with home base, and Starfleet doesn't necessarily start worrying until after months or even years. It would be pretty darn difficult to issue credible warnings about illegitimate ships against that sort of background noise.
For an "on the third hand" argument (this is, after all, both Star Trek and Halloween Hangover), it is a prominent feature in the Trek universe that certain starship designs are in common use across cultural borders. Officially, this sort of begins with "Heart of Glory" where the only way to tell a certain freighter for a Talarian vessel is to wait for her pennant paint to become visible. Anybody with a brush and some vacuum-proof paint could thus engage in "false flag" piracy - and anybody who ever navigated the spacelanes would know of the risk of such things, and be wary of approaching ships, even if these flew the Starfleet flag.