The transaction may be declared invalid on two grounds - it can be recognized as such by the court (voidable transaction), or without the need of such recognition (void transaction). The requirement of recognition of invalidity of the transaction is provided by the parties in court.
The contract of suretyship is one of the ways to ensure fulfillment of obligations, along with the Bank guarantee, the Deposit and the penalty. The invalidation of the contractsecured by the surety, shall entail the invalidity of the guarantee itself. However, the contestation of the surety regardless of whether the main contract in a judicial order.
The civil code of the Russian Federation names the following grounds of invalidity of transactions:

- if the transaction is made in violation of the law;

- if the transaction is contrary to the principles of public order and morals;

- if the transaction is imaginary or feigned;

- if it is made of an incapacitated person or a person limited in capacity;

- if the transaction was executed under the influence of delusion, deceit, violence or malicious agreement of the parties.
For invalidation you need to go to court with a claim, which refer to one of the above grounds. After the recognition by the court of your arguments legitimate a decision will be made for cancellation of this agreement. The transaction, recognized as invalid does not entail any legal consequences. All executed transaction must be returned to the parties, if possible. If you cannot return received under the transaction in kind, must be returned to the cash equivalent of the benefit.