The Enterprise-D had 2 fatal flaws:
1. The ship status displays in Main Engineering advertised the shield frequency for all to see.
2. Apparently, in combat, if the ship takes a couple of hits to the Engineering section, her phaser power is reduced to the point where they have absolutely no impact at all against the shields of a 20-year old Bird of Prey.
Security was no better on Voyager(where the EMH could access -and- change the frequency from Sickbay) or the Defiant. The Federation is a very trusting place. Not to mention if you're a hostile boarder and have manged to board the ship... chances are you've already bypassed the shields in some way anyhow.
The flaw was they fired one time... that's it. Then they turned around where most of the weapons were facing away from the ship and their engines and other vulnerable parts(which ended up causing the problem that blew them up) were facing towards them. The flaw was in the big chair of the bridge there. William T. Riker.