I am wondering if there is a word that essentially means "intentional bug", that the designers or maintainers of the software either introduced knowingly or preserved after recognition of its existence.
I believe it's called "Quirk".
This was widely used in HTML (Quirks Mode) to maintain backwards compatibility with some old web pages:
Features that are not based on functional requirements, but are intended to provide entertainment and/or amusement, are called Easter eggs. Security-related bugs installed for malicious purposes are typically referred to by terms specific to the nature of the bug, such as back door (often written as one word) or logic bomb.
I just call them intentional bugs. I think a lot has to do with how the developer handles it. Also, the developer's intentions. Sometimes the dev thinks they're introducing a feature, and they have good intentions. Other times, they're trying to sneak something malicious in here. So, how to refer to it?
If the developer responds to the bug report by expressing apologies and/or an intention to remove the bug, it may never be known that it was even intentional in the first place. This is the correct response. In this case, it's merely a bug.
If the developer refuses to address the bug reports, remaining silent while not fixing the bug, it's generally referred to as an "intentional bug," and could be considered malware, depending on the developer's intentions, which we don't know because they're suspiciously silent. Google is famous for this.
If the developer responds emotionally with, "It's not a bug! It's a feature!" then it's clearly and definitely malware. Much the same way that, if a person is accused of manslaughter and they say, "I didn't accidentally kill him! I murdered him on purpose!" they would be charged with murder. This is the stupidest possible way a developer could respond to a bug report, but oddly enough it's very common.
Some people say bugs are accidental by definition. This isn't necessarily true. Some bugs are intentional, either because the developer thought it would be a feature, or because they were malicious. Those people are thinking of glitches.
Here's the difference: A glitch is something the developer didn't intend. A bug is something the user doesn't want.
Besides Easter egg, the other not-really-words-but-anecdotes that spring to my mind are turbo button and duck.
If you deliberately slow down (or otherwise cripple) your product, and then supply a feature that "improves performance" by simply disabling the slowdown code, you might have invented the turbo button.
To use the turbo button, you pushed the button before you loaded a program that didn’t like high speeds. After you finished, you pushed the button again to restore normal speed. [...]
One point of eternal debate is whether pushing the button in made the computer faster or slower. The answer? There was no standard. It depended on your board. In practice, those of us who had PCs with the button figured out which position was faster and we kept the switch in that position most of the time.
The same concept is described in DailyWTF story "The Speed-up Loop":
"That, my friend, is what we call a ‘speed-up loop.’ We put those in for insurance purposes, really. Whenever we have those really slow weeks – you know, the kind where we don’t actually fix any bugs or make any other changes – we just drop one of the zeros on the loop. And then we just tell the manager that we ran into some speed issues with the latest change request, but after a whole lot of deep-juju optimization, we were able to speed things up significantly..."
On the other hand, if you put in the misfeature expecting it to get caught by management, you've got a duck.
It was well known that the producers had to make a change to everything that was done. [...] The artist working on the queen animations for Battle Chess was aware of this tendency, and came up with an innovative solution. He did the animations for the queen the way that he felt would be best, with one addition: he gave the queen a pet duck. He animated this duck through all of the queen's animations ...
Eventually, it came time for the producer to review the animation set for the queen. The producer sat down and watched all of the animations. When they were done, he turned to the artist and said, "That looks great. Just one thing — Get rid of the duck!"
In the trade, an "intentional bug" is a "feature". Your use of "bug", implying something unexpected by the user but intended by the designer, would suggest the feature would be hidden, perhaps changing the term you are looking for to better be "hidden feature". An example of a hidden feature would be a "back door", a way that the writer can gain access to the system avoiding all the security. A user would see this as a "bug" but it has historically (less so today) been a legitimate tool for supporters to use when assisting users, so a deliberately designed but hidden feature.
Unwanted behaviour is what people usually call a bug. By definition, a deliberate behaviour, unless malicious, would be wanted so isn't at all what is meant by "bug". Malicious stuff shouldn't bee referred to as bugs because it is inserted quite deliberately and is very much there by design to do what someone wants. Malicious stuff would have alternative names like "malicious code", "virus", "Trojan" and more and I've never seen such things referred to as "features" (though technically they are specific examples of features).
[this added as an edit to reply to the later comment on deliberate "bugs" that are unhelpful]. OK - it's definitely true that someone could add some code that caused unwanted effects. Typically, "malicious code" covers any unwanted behaviour introduced deliberately. Most people would understand malicious code to be something vary harmful but even those stupid messages that say you will suffer the wrath of God unless you resent it to 40 friends is a type of virus (working by psychology rather than coded functionality) and you'll hardly suffer any harm at all if you don't do as told. So "malicious code" simply produces a deliberate (designed) result a user would not want or appreciate. You could also call such a "malicious feature", though it's not a common way to describe it. The word "bug" is definitely inappropriate - bugs are accidental (even the writer does not know a bug exists until someone accidentally chances on it).