Australia's biggest bank took four years to discover a programming error affecting 10,500 personal overdraft customers.
The error occurred after Commonwealth Bank introduced an automated system for assessing personal overdraft applications in July 2011.
It went undetected for more than four years, the financial services royal commission heard on Tuesday.
Senior CBA executive Clive van Horen said the bank had a number of controls in place that it would normally expect to identify errors.
"So yes, a number of controls in place that didn't detect it in this case until 2015," CBA's executive general manager of retail products said.
Once the problem was detected, it was fixed in 17 days.
The bank estimated it affected about two per cent of its personal overdraft customers.
Mr van Horen said 9400 customers were approved for personal overdrafts that should have been declined while 1100 received a higher overdraft limit than they should have had.
The error in the automated serviceability calculator meant the bank failed to take into consideration the declared housing and living expenses of some consumers between July 2011 and September 2015.
The calculator instead substituted zero housing expenses and living expenses based on a benchmark, meaning some people got an overdraft or increased limit when their declared expenses were greater than their income.
CBA paid $180,000 in fines for breaching responsible lending laws and wrote off $2.5 million in personal overdraft balances in 2016.
The royal commission also heard ANZ sent out 330,000 offers of pre-approved overdraft facilities of $500 or $1000 to existing customers in 2014.
ANZ paid $212,500 in fines in 2016 for breaching responsible lending laws by failing to make reasonable inquiries about the credit limit a customer required.
Counsel assisting the commission Albert Dinelli said the inquiry will also examine account administration and processing errors by ANZ.
The bank refunded $69.3 million to 400,000 customers affected by processing errors with its 'breakfree' home loan.
Between 2003 and July 2013, some customers were charged a higher interest rate than they should have been.
Mr Dinelli said some offset accounts were also not properly linked to home loans, resulting in customers being charged excess interest.
The problems primarily arose because of limited system controls to ensure the correct package interest discounts were applied, he said.
Mr Dinelli said the commission will also look at four further issues involving processing errors with ANZ's home loan products.
Australian Associated Press