Attacks on semi-device independent quantum protocols