Apple's next software update for its iPhones and iPads will fix a security flaw that allows hackers to engage in spying and cyber crimes when the victim connects the device to a fake charging station, the company says.

Apple's devices are vulnerable to attacks until the company releases its iOS 7 software update, which is slated for spring.

Three computer scientists, who alerted Apple to the problem earlier this year, demonstrated the security vulnerability at the Black Hat hacking conference in Las Vegas on Wednesday where about 7000 security professionals are learning about the latest threats posed by computer hacking.

Apple said the issue had been fixed in the latest beta of iOS 7, which has already been released to software developers.

"We would like to thank the researchers for their valuable input," Apple spokesman Tom Neumayr said.