I know the USS Vengeance in Star Trek Into Darkness fired on the USS Enterprise while at warp, but wasn't there some technical rule about weapons at warp?
On Page 84 of the Deep Space 9 Technical Manual:
a phaser beam can be delivered at warp speeds due to an annular confinement beam jacket and other advances in subspace technology
On multiple occasions we see a torpedo being launched by a starship whilst at warp. The idea behind this is that the torpedo is capable of maintaining the warp field it had when fired from the ship, but eventually slows out of warp.
The propulsion system of the torpedoes is a warp sustainer engine. The engine coils of the torpedo grab and hold a hand-off field from the launcher tube's sequential field induction coils. A miniature matter/antimatter fuel cell adds power to the hand-off field. When launched in warp flight, torpedo will continue to travel at warp, when launched at sublight, torpedo will travel at a high sublight speed, but will not cross the warp threshold. (pg. 129 of the The Next Generation Technical Manual)
There are numerous examples of ships firing all sorts of weapons while at warp, especially in the TNG era series', but as early as Enterprise.