In the wake of the barbarous attack on Kenya’s Westgate shopping mall last month, United Nations Secretary-General Ban Ki-moon wants decisive action against the group responsible for at least 67 deaths, the Somalia-based al-Shabaab.

He proposes adding 4,000 African Union troops to the 18,000 already in Somalia and providing the forces with attack helicopters and other advanced equipment so they can pursue al-Shabaab in its sanctuaries in the rural south.

The idea sounds reasonable. In addition to attacking Kenya, al-Shabaab struck Uganda in 2010, killing more than 70 people, and this year it has repeatedly assaulted Somalia’s capital, Mogadishu. The group controls parts of southern Somalia, including the port of Baraawe, from which U.S. commandos retreated under fire earlier this month, having failed to capture an al-Shabaab commander.

Before the UN expands the role of the AU troops, however, it should first work to clean up the mission. One of its components, the 4,600-strong Kenyan contingent, has been a force for ill as much as good in the effort to stabilize Somalia; its corruption is even helping to enrich al-Shabaab.

The Kenyan troops have been instrumental in ejecting al-Shabaab from its urban strongholds, notably the city of Kismayo in September 2012. The port had been key to al-Shabaab’s $25 million a year in earnings from the export of charcoal made from acacia trees. The razing of trees for this trade has turned lush areas of Somalia into deserts, which contributed to a famine in 2010 and 2011 that killed 260,000 people, according to the UN’s estimate. In 2012, the UN Security Council banned the import and export of Somali charcoal.

One might have expected the Kenyans, once in control of Kismayo, to enforce the export ban. Instead, they collaborated with the Ras Kamboni militia led by a former al-Shabaab ally to increase violations. By July 2013, Somalia’s charcoal exports had risen 140 percent.

The trade at Kismayo is divided between Kenyan business interests, Ras Kamboni and, astonishingly, al-Shabaab. People connected to the group control a third of the exports, and al-Shabaab continues to tax trucks heading to Kismayo. With the income from exports from Baraawe, the charcoal trade is earning al-Shabaab more than ever, the UN estimates.

So before pushing to expand the AU force -- which the UN supports logistically -- Ban should first require that the Kenyan contingent respect the charcoal sanctions. The U.S., which has provided training and other assistance for the Kenyans, and the European Union, which pays their allowances, should second the demand.

Ending the Kenyans’ corruption is essential to repairing the AU mission’s credibility, as well as the UN’s. Cutting off al-Shabaab’s charcoal profits would also make the group more vulnerable to Ban’s proposed assault on its remaining refuges.

To contact the Bloomberg View editorial board: view@bloomberg.net.