And if so, have there been any recorded instances of this?
(I'm excluding the so-called "jail broken" devices.)
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
Yes, security vulnerabilities that would allow people to hack or infect Macs and iOS products do exist, though they're not exploited very often.
Pwn2Own is an annual contest where competitors try to hack into machines to win them as prizes. Both Macs and iOS products are hacked most years.
Friday, Apple released an update to its mobile operating system (iOS 4.3.4) which patches a couple of vulnerabilities that left a door open for malware infections on the iPad, 3rd and 4th generation iPod touch, iPhone 4, and iPhone 3GS.
Apple's update describes the CoreGraphics vulnerability as "A buffer overflow…in FreeType's handling of TrueType fonts. Viewing a maliciously crafted PDF file may lead to an unexpected application termination or arbitrary code execution."
This update comes on the heels of an alert from German IT group BSI, which warned of an unpatched vulnerability that would "allow attackers to gain access to the entire system with administrative privileges."
Apple does "verify" any software for their App Stores, but developers have been known to sneak in features without Apple's testers seeing them, so don't expect this to entirely protect you.
The fact that the devices can be jail broken at all means that there are exploitable weaknesses in the security of iOS, because jail breaks involve bypassing the usual security to be able to run software that you couldn't otherwise run.
But -- being jail broken doesn't necessarily mean you are more vulnerable.
That said, unless the jail breaker's are lucky and can find a serious flaw like the recent PDF exploit, jail breaking an iOS system can be a little involved. Someone might be able to get you to click on a link on a website, but not go through a multi-step procedure where you are rebooting the devices with buttons held down, etc.
I've not heard of an in-the-wild trojan/virus for iOS.
I think the answers here are a bit misleading. iOS is widely held to be the most secure software platform, mobile or otherwise. Any human made software system is vulnerable, but so far there has been no malware of any sort reported for iOS. It's an attractive target, though, and the existence of jailbreak exploits means that it's not impossible.
It is possible, but not likely to get a virus from an app. All iOS apps are vetted by Apple. A virus is generally malicious code installed and run unintentionally. Because all apps are checked, unless you jailbreak jailbreak device, you should be safe.
On the other hand, as has been pointed out in the comments, it is quite possible that an iOS device can get infected via vulnerability in Safari or, as was specifically mentioned, the PDF reader. This is possible largely because the content that comes in from the web is not checked by anyone. The situation is worse on iOS because you cannot install antivirus. (Apple wouldn't allow an app that integrates that deeply with the OS into the store.) Contrast that with "traditional" computing environments where such protections are available.