A contract's content cannot be changed internally. Only the smart contract itself is allowed to modify the storage. A contract's storage can only be changed via a transaction. I don't think there can be a possibility that the content of the contract can be changed illegally.