Philip Hammond has rejected claims the government has been too slow to support tenants trying to have dangerous cladding removed from their properties.
Labour MP Rushanara Ali said many residents were fighting legal battles with their landlords and did not believe ministers were "on the side".
She asked the chancellor if he could "live with" another Grenfell tragedy.
He said the claims were "unfair" and the government was ready to fund all urgent cases involving social housing.
Cladding on 228 buildings failed safety tests after the Grenfell Tower fire, in which 71 people lost their lives.
During a hearing of the Treasury select committee, Ms Ali suggested only seven out of 160 social housing blocks with flammable cladding similar to that used in the west London tower block had so far had it replaced.
She said some housing associations and councils did not have sufficient funds to do the work while others were finding it to difficult to access money and the government should simply "underwrite" the cost.
"The government is shirking responsibility," she said. "The question is are you going to be able to live with yourself if this happens again when these properties have not had the work done."
The MP for Bethnal Green and Bow, in east London, said ministers were not aware of how many private blocks were similarly affected and their residents should not have to "wait years" before the work is done.
"The government has to be on the side of people who have to live in these properties and, at the moment, they don't think feel they are… not only on social housing but in private blocks."
Ministers, she said, should "go after" private landlords "rather than leaving residents and leaseholders to fight these battles in order to live safely without fear of dying in fires?"
Mr Hammond said social landlords had a duty to ensure their properties were safe and that lack of finance should not prevent urgent safety work from taking place.
He said claims of government complacency were "unfair" as the Housing Secretary Sajid Javid was "all over" the issue.
- What happened at Grenfell Tower?
Any social landlord whose property needed urgent repairs should approach the Ministry of Housing which could, Mr Hammond said, potentially relax council borrowing rules or spending caps to fund repair work.
"It is a very challenging issue and obviously these blocks need to be re-clad. In some cases the work is urgent and needs to be done urgently but we have to be led by the expert professional advice," he said.
And he acknowledged that the situation in relation to private blocks was "more complicated".
"I accept it is a challenge. But there is only a certain amount of finance available and diverting public housing funding to leaseholders in private blocks would be a very significant decision."
A public inquiry into the June 2017 Grenfell blaze is continuing.
A review of building regulations ordered after the tragedy found the system was "not fit for purpose" and open to abuse by those trying to save money, according to an interim report in December.