BERLIN  A German government agency warned citizens on Wednesday about two software vulnerabilities in Apple’s mobile operating system, iOS, which it said could be exploited to infect the company’s best-selling iPhone, iPad and iPod devices.

The agency, the German Federal Office for Information Security, said its technical experts had confirmed the vulnerabilities in several versions of iOS, which could be exposed when Apple users visited infected Web sites or opened infected PDF documents. The agency, a branch of the German Interior Ministry, is charged with warning government employees and the public of software threats that could compromise private communications.

Apple acknowledged the security flaw and said a fix would be forthcoming.

“We are aware of the reported issue,” said Natalie Harrison, a spokeswoman for the company. “We have already developed a fix and it will be available to customers in an upcoming software update.” She declined to say whether the security flaw had been exploited by hackers.