Tensions between the nuclear-armed neighbours have escalated with India launching strikes on Pakistan following last month's deadly attack on tourists in the Indian-administered side of the contested Kashmir region.
Malaysian Agriculture and Food Security Minister Mohamad Sabu said nearly 40 percent of the country's imported rice came from India and Pakistan.
"Their political and economic stability is crucial for food security in Malaysia," Mohamad told local daily New Straits Times.
"If a war or tensions occur that affect port operations or delivery infrastructure, rice imports to our country could be disrupted," he said.
India supplied white rice, while basmati rice came from Pakistan -- both staples for most of Malaysia's 34 million residents.
"If the situation in that region escalates, it will certainly have a direct impact on us, particularly in terms of prices and supply continuity," Mohamad told the paper.
Currently Malaysian rice supplies were stable, but the Putrajaya-based government was boosting ties with other rice suppliers in the region including Vietnam, Thailand and Cambodia.
India and Pakistan exchanged heavy artillery fire along their contested frontier in Kashmir on Wednesday after New Delhi launched missile strikes on its arch-rival, with deaths subsequently reported on both sides.
New Delhi accused Pakistan of backing the deadliest attack in years on civilians in Indian-administered Kashmir on April 22, in which 26 men were killed.