The youths, aged 15 and 16, were arrested last Friday in the northern city of Nahariya, according to Israeli press reports.
They created the worm as part of a competition with a rival group of hackers, the reports said. If convicted, the youths could face three years to five years in prison.
Hundreds of thousands of computers around the world received the Goner worm as an e-mail attachment disguised as a screensaver. But researchers have said the economic damage caused by the attack was relatively small, partly because anti-virus software vendors reacted quickly with virus-definition updates.