Home Depot Inc. confirmed Monday that its payment systems were breached at nearly 2,200 U.S. and Canadian stores in a cyberattack that may have stretched back to April.

The company said it is working aggressively to root out the malware that infected its data systems and protect its customer data, but stopped short of addressing when or whether the breach had ended.

The...