If you talk about the legality of an action or situation, you are talking about whether it is legal or not.
The auditor has questioned the legality of the contracts.
审计员已经质疑合同的合法性。