Understanding and mitigating attacks targeting web browsers