(Adds quotes from presidential candidates)
By Stephen Eisenhammer
RIO DE JANEIRO, Sept 7 (Reuters) - Brazil's October presidential race has been shaken up by a corruption scandal allegedly involving state-run oil firm Petrobras and dozens of lawmakers, with both leading candidates forced onto the defensive after colleagues were implicated.
Media reported on Friday night that a jailed former Petrobras director had named dozens of politicians who allegedly received kickbacks off the company's contracts.
The revelations are a headache for President Dilma Rousseff, undermining her reputation for zero tolerance on corruption just as she is slipping in the polls ahead of the Oct. 5 election.
It could also hamper opposition candidate Marina Silva.
But the scandal has given third-placed Aecio Neves a fresh rallying call as he tries to claw back into the race.
He is already on the offensive, branding the scandal "mensalao 2" in reference to the "mensalao," a vote-buying scheme in Congress that tainted former president Luiz Inacio Lula da Silva while he was in office.
On Saturday, the magazine Veja printed the names of those implicated in the Petrobras scandal. Among them were former governor and presidential candidate Eduardo Campos, who died in a plane crash last month; the minister for energy and mines, Edison Lobão; the president of Congress' lower house, Henrique Eduardo Alves; and the Senate president, Renan Calheiros.
Those allegedly involved in the scheme were said to have received a 3 percent kickback off the oil firm's contracts with third parties between 2004 and 2012. The money swapped hands in order to maintain political support between parties, Veja said.
The names were given by Paulo Roberto Costa, former head of Petrobras' refining and supply unit, who was arrested in March as part of a police investigation into money laundering.
Alves issued a statement denying receiving funds from Costa. Press aides for Lobão and Renan said they had no position yet on the issue, while officials at Petrobras were not immediately available for comment.
Rousseff has always stressed her credentials as a no-nonsense manager, with development of Brazil's oil riches an important part of that image.
She spoke to reporters in Sao Paulo on Saturday.
"I assure you I will take the necessary action. But I will not act based on speculation, I want the details," she said.
Expectations that the scandal would further boost Silva's candidacy are countered by the alleged involvement of Campos in the scheme.
Silva, who was Campos' deputy, has spent her life campaigning against precisely the type of corruption outlined in the media reports.
Support for Silva has surged in polls in recent weeks, and she is now seen winning a second-round runoff, helped by a mix of national grief over Campos' death and her promise of a new type of principled politics.
"Petrobras is being destroyed through political interference, patronage and corruption," Silva told reporters in Sao Paulo on Sunday.
Her deputy on the ticket, Beto Albuquerque, defended Campos and said his PSB party had asked for access to the police investigation into the alleged corruption.
The one mainstream candidate not directly implicated in the scandal, Neves - currently running third in the polls - was quickly on the offensive.
"There is a criminal organization operating within Petrobras," Neves said in an interview on Sunday, adding that Rousseff's Workers' Party had exploited the company to keep itself in power. "We have to end impunity in Brazil," he said. (Editing by Hugh Lawson and Paul Simao)