The federal government believes Canada is vulnerable to a significant terrorist attack because of legislative gaps that hinder and, in some cases prevent, federal agencies from sharing information about potential threats.

Government sources tell CBC News that legislation to be tabled when Parliament resumes later this month will provide national security agencies with explicit authority to obtain and share information that is now subject to privacy limits.

The legislation is the centrepiece of a package of wide-ranging security measures to be unveiled in the coming weeks. They include:

Changes to the privacy limits governing information submitted in passport applications to allow it to be shared with national security agencies.

Authorizing information on the movement of controlled goods such as automatic weapons and tracking devices, and substances that can be used to make chemical weapons, to be shared with investigative agencies.

Making it easier for police to detain suspected extremists.

A new strategy to help prevent young people from becoming radicalized.

These gaps were identified in an extensive review begun after the separate attacks last October by Martin Couture-Rouleau, who ran over and killed a Canadian Forces member in a hit-and-run attack, and by Michael Zehaf-Bibeau, who stormed Parliament Hill armed with a hunting rifle after shooting a Canadian Forces soldier in the back as he stood guard at the National War Memorial.

"We've seen an attack with a car, and an attack with a gun,'' one official told CBC News. "The concern is that we have significant gaps in our ability to track not just suspected terrorists but material coming into the country that they can use in an attack.''

Government officials say the public would be shocked to know that, for example, Canada can share information about missing chemicals in a shipment with its international allies, but not with national agencies that could investigate what happened.

A modern liberal democracy

The government's intentions have been signalled for a while now, and civil rights experts are warning that expanding police powers of surveillance, detention and information sharing must, at the very least, be accompanied by increased oversight either by Parliament or an independent watchdog.

Canadian Public Safety Minister Steven Blaney lays a wreath in Paris after Friday's attack on a kosher market in which four hostages died. (Peter Dejong/The Associated Press)

There's also concern that free speech and other constitutionally protected rights are being flattened in the stampede to greater security.

In Britain, for example, the government is proposing measures to give authorities the power to match internet addresses to the specific device and individuals using it.

Prime Minister David Cameron said this week that the attacks in Paris, in which 17 people died, are proof ''terrorists cannot be allowed safe space to communicate with each other.

"And the powers I believe we need, whether on communication data or on the content of those communications, I am very comfortable that those are absolutely right in a modern liberal democracy.''

It's not clear how far Canada is prepared to go in that direction, nor is it possible to say that any of these measures would have prevented either of the October attacks.

Couture-Rouleau was already under police surveillance before he used a car as a lethal weapon. And RCMP Commissioner Bob Paulson said the force was aware Zehaf-Bibeau had applied for a passport, but told reporters they did not have information at that time to indicate he was a threat.

Still, Prime Minister Stephen Harper and Public Safety Minister Steven Blaney have both said they will ensure police have what they need in the battle against homegrown extremists.

"We are more dedicated than ever to track those individuals and enable those who are there to protect us — law enforcement, intelligence — to enable them with the tools that are needed," Blaney said on CBC TV's Power & Politics this week.

Counter-radicalization

Those new powers would almost certainly be welcomed by police.

Ray Boisvert, the president of I-Sec Integrated Strategies and a former assistant director of intelligence for CSIS, says CSIS agents are routinely ''jammed up by privacy issues'' when trying to access information held by other Canadian departments.

While stationed overseas, Boisvert learned that a Canadian citizen who travelled extensively in the Middle East had been issued with three replacement passports. But it took months of paperwork and intervention at the highest levels of both CSIS and Foreign Affairs to get the passport holder's name in order to investigate.

"Quite often the biggest success stories in intelligence work and actually solving crimes has been the ability to connect dots,'' he says.

"That's why we need to be able to get at those bits of information. Ensure there are strict rules and controls, but ensure that somebody can reach into a database and check to see if there's a match. And if they do, then at that point let them make a case for access to it.

Sources also tell CBC News that other measures are being considered that would allow CSIS agents to tell the RCMP about any interviews they have had with parents and youth suspected of being radicalized. They would be part of a new counter-radicalization strategy.

Michael Zekulin, a terrorism expert at the University of Calgary, says the goal is to prevent the next generation of fighters by working with mosques and others in the Muslim community to counter the jihadist message on social media, and to identify signs of radicalization and work with parents.

"If we understand radicalization as a process, the earlier you intervene the more likely you are to turn those young people around and to offer alternatives,'' he says.