VIENNA — The legions of desperate migrants fleeing war and mayhem in the Middle East and Africa have long known they were risking harm from unscrupulous smugglers and death at sea to reach the safety of Europe. But it became shockingly clear on Thursday that they now face the same dangers within Europe’s own borders.

A white truck filled with the decomposing bodies of as many as 50 smuggled migrants was found abandoned on the outskirts of Vienna in the summer heat. The discovery came just as European leaders were meeting in a nearby palace to devise new ways to cope with the migration crisis.

News about the corpses instantly overshadowed the meeting and transfixed Europe with new worries that the scope and complexity of the crisis had escalated.

European Union officials have been struggling for ways to control the tens of thousands of migrants who are now reaching the continent, without forfeiting the free movement between member countries that is a fundamental part of life in the 28-nation bloc. Now its members are confronting human traffickers who are exploiting the open borders.