Recently, I created a custom InfoPath form which worked fine on the preview. After publishing to a SharePoint List, the Web form's attachment control in a repeating section failed with the following error.
"The security Validation for this page is invalid. Click back in your Web Browser, refresh the page and try your operation again"
I made the following changes to fix the error.
<SharePoint:FormDigest runat="server" />
Retry the InfoPath web form, it should be working now.