Mass. Gen. Laws ch. 254, § 22
Costs shall be in the discretion of the court and shall be paid from the proceeds of the sale or by any of the parties, as it may order.