Does the Stirge blood drain allow it to flank as well?

I am playing a Beast Master ranger with a stirge animal companion.

I know that once a stirge is attached to an enemy, it doesn’t need to use its action or anything; Blood Drain’s damage is passive/automatic, with no action required.

If it attaches to the back of an enemy, does that count as flanking (per the optional rule from the DMG) while it’s attached?

Can an attached stirge deal no more than 10 HP of damage before it detaches?

An attached stirge deals 5 (1d4+3) HP of damage at the start of its turn each round. The statblock states:

The stirge can detach itself by spending 5 feet of its movement. It does so after it drains 10 hit points of blood from the target or the target dies.

The monster description later states:

A stirge attacks by landing on a victim, finding a vulnerable spot, and plunging its proboscis into the flesh while using its pincer legs to latch on to the victim. Once the stirge has sated itself, it detaches and flies off to digest its meal.

Assuming rolling for damage rather than just applying average damage, should the damage be capped at exactly 10, at which point the stirge detaches? Or should the full damage from the damage roll that puts the total over 10 still apply?