Supermarket giants braced for massive legal bill