A vast number of people gathered at the UN agency's food distribution centre when the attacker detonated a suicide vest.
A government hospital official reported after the attack, "I myself have counted 40 bodies but the death could rise as several wounded people are in critical condition."
Geo News channel claimed that the suicide attack was carried out by a woman though this could not be independently confirmed.
No group has so far claimed responsibility for the attack. Authorities usually blame the Taliban for such bombings.
The World Food Programme had set up the centre to distribute food aid to people affected or displaced by an anti-Taliban operation launched by security forces in Bajaur tribal agency.
The injured were taken to the region's state-run hospital, where authorities declared an emergency.
Witnesses said security forces cordoned off the area and launched a search operation.
Reports said that up to 1,000 people received food every day at the distribution centre at Khar, the headquarters of Bajaur.
The security forces had launched a major ground and air offensive against the Tehrik-e-Taliban Pakistan in Bajaur in 2008.
(With inputs from PTI)