By some estimates, more than 15,000 foreign fighters from more than 80 countries have joined the Islamic State (IS). According to the CIA, that’s anywhere from half to three quarters of its entire force. While this infusion has certainly swelled IS ranks and fueled its expansion from Syria to northern Iraq, there is a greater danger afoot. What happens when these foreign fighters return, hardened by battle and desensitized to violence? More pressing is the question of the legal grounds upon which countries like the US and its allies in the coalition can take actions against foreign fighters in a foreign land who, at least not until the coalition started it’s airstrikes, did not engage in hostile activities against coalition members.

The question is all the more urgent because some foreign fighters are already back on home soil. In the UK, it is believed that as many as 250 have already returned from a tour with the terrorist group. Many more extremists have returned to the Middle East and southwest Asia. Moreover, it is widely assumed that are more around the world whose identities are as unknown to their home governments as their intentions. In the UAE, the authorities recently discovered and prosecuted a group that was aiding IS and was even conducting paramilitary training.

There is no question that these foreign fighters must be somehow engaged upon their return. Not only are there immediate security threats to consider, there is the long-term danger of allowing extremism to seed and spread throughout the world – just as it did in the Middle East when thousands returned from fighting the Soviets in Afghanistan. The problem is that legal systems are almost universally ill-equipped to decisively deal with foreign fighters who are involved in activities on foreign soil or with citizens who are engaged in activities abroad.

Consider that almost all laws apply within the country that enacted them. What happens when a country wants to prosecute crimes committed abroad, particularly when those crimes have no impact on the home country’s land or citizens?

The United States’ approach is likely the most evolved – including the criminalization of “material support to terrorist organizations” and preemptive programs aimed at curbing extremism before it leads a young man to become a foreign fighter. Even so, it’s hard to predict how these laws will stand up in the IS era, should any of the estimated 33 U.S. citizens currently fighting for the group return home – likely not having fired a single shot at a U.S. citizen or soldier.

The challenge is even more pronounced in the Europe, from which a far larger percentage of foreign fighters hail. The UK proposes to charge foreign fighters with treason (for pledging allegiance to a foreign entity) have already been panned by many counterterrorism officials as fraught with legal problems and ultimately ineffective. Of the 15 individuals charged under the UK’s Terrorism Act, only three have been convicted.

Denmark’s far softer approach – which seeks to reform and de-radicalize foreign fighters while allowing them to walk the streets – is dangerously naïve at worst. At best, it is a model that isn’t politically viable just about anywhere else in the West.

The UAE recently took a progressive step by enacting Federal law No 7/2014 to encounter terrorism activities. Although the law deals mainly with terrorism activities within the UAE, it makes an attempt to capture activities conducted abroad but only if UAE nationals or interests are at stake. The law, however, does make an effort to punish individuals who join a terrorist organization abroad but what would be deemed a terrorist organization is yet to be defined.

Throughout much of the rest of the world, legal frameworks remain mired in pre-9/11 philosophies. Where there are measures in place to prevent foreign fighters from exporting the IS brand of terror, they are woefully outdated. The current laws have never envisaged the situation similar to what the IS has created. What is certain is that terrorism has evolved and so should the legislative framework. Otherwise the world will soon be faced with activities that threaten its safety and security but for which no laws can be found to deal with.

The May 2014 murders at the Jewish Museum in Brussels and the recently-foiled plot to commit “propaganda of the deed” beheadings in Australia were both carried out by returning IS veterans. These and other attacks lead to two critical conclusions. First, that no country is immune to the scourge of IS extremism. And second, that every country shares the responsibility of containing it.

It starts with our laws – and making the reforms necessary to effectively keep up with an evolving and expanding threat of terrorism in the 22nd century.