{"id":23520,"date":"2020-11-20T14:35:00","date_gmt":"2020-11-20T10:35:00","guid":{"rendered":"https:\/\/www.cs-cart.com\/blog\/?p=23520"},"modified":"2026-05-07T15:27:52","modified_gmt":"2026-05-07T11:27:52","slug":"possible-csrf-attack-error","status":"publish","type":"post","link":"https:\/\/www.cs-cart.com\/blog\/possible-csrf-attack-error\/","title":{"rendered":"Access Denied: Possible CSRF Attack Error"},"content":{"rendered":"\n<p>CSRF attacks can make your site vulnerable in front of malicious users. They are dangerous as when your sensitive data is lost, your business prosperity is under the threat. That\u2019s why store owners should be aware about what CSRF attack is, how to prevent it and what to do if a possible CSRF attack has been already detected. This article gathers common cases encountered by CS-Cart users and practical solutions based on real project experience.<\/p>\n\n\n\n<h2 id='what-is-csrf'  id=\"boomdevs_1\" class=\"wp-block-heading\" id=\"h-what-is-csrf\">What is CSRF?<\/h2>\n\n\n\n<p>Cross-Site Reference Forgery, XSRF, \u201cSea Surf\u201d, Session Riding, Hostile Linking or One-Click attack (as referred to by Microsoft). The names can be different but in general a CSRF attack is a sort of activity designed to trick the victim into sending a malicious request. The attacker gets the identity and privileges of the victim to run an undesired function on behalf of the victim.<\/p>\n\n\n\n<p>The fact is that the browser automatically includes the user credentials associated with the site (session cookie, IP address, Windows domain credentials, etc.). When a user is authenticated to the site, the site does not make a difference between the forged request sent by the victim and a legitimate request sent by the user.<\/p>\n\n\n\n<p>Any functionality that causes a state change on the server is potentially vulnerable to the CSRF attack. The examples of such state-changing functionalities can be:<\/p>\n\n\n\n<ul>\n<li>Change of the victim\u2019s email address;<\/li>\n\n\n\n<li>Change of password;<\/li>\n\n\n\n<li>Purchasing something or transferring funds.<\/li>\n<\/ul>\n\n\n\n<p>With the use of social engineering (the attacker can send a malicious link via email or chat), an attacker deceives the user to execute the desired action.&nbsp;<\/p>\n\n\n\n<p>For administrative accounts, a successful CSRF might end with compromising the entire web application.<\/p>\n\n\n\n<h3 id='why-do-csrf-attacks-happen'  id=\"boomdevs_2\" class=\"wp-block-heading\" id=\"h-why-do-csrf-attacks-happen\">Why do CSRF attacks happen?<\/h3>\n\n\n\n<p>CSRF attacks are feasible because web apps trust the cookies sent by web browsers via an HTTP request. The attacker manipulates the victim\u2019s browser to make a request resulting in a change of the server state, a state which is beneficial to the attacker (like transferring funds, for example).<\/p>\n\n\n\n<h3 id='how-to-prevent-csrf-attacks'  id=\"boomdevs_3\" class=\"wp-block-heading\" id=\"h-how-to-prevent-csrf-attacks\">How to prevent CSRF attacks?<\/h3>\n\n\n\n<p>An attacker can execute a CSRF attack when he knows which parameters and value combination were used in a form. Adding an additional parameter containing a value unknown to the attacker, but allowing its validation by the server, can help you avoid CSRF attacks.<\/p>\n\n\n\n<p>Administrative accounts like banks or eCommerce merchants need to transition from&nbsp;<strong>cookies&nbsp;<\/strong>that perform session-tracking to session&nbsp;<strong>tokens&nbsp;<\/strong>that are dynamically generated. These actions will make holding the client\u2019s session more difficult for an attacker.<\/p>\n\n\n\n<h3 id='how-do-tokens-work'  id=\"boomdevs_4\" class=\"wp-block-heading\" id=\"h-how-do-tokens-work\">How do tokens work?<\/h3>\n\n\n\n<p>A token or a CSRF Protection Token also known as a Synchronizer Token, works as follows:&nbsp;the client requests an HTML page that contains a form with the user credentials. After the user submits the form, the client sends the tokens back to the server. At this,&nbsp;<strong>cookie tokens&nbsp;<\/strong>are sent as cookies, and&nbsp;<strong>form tokens<\/strong>&nbsp;are sent as part of the form data.<\/p>\n\n\n\n<h3 id='how-to-fix-an-invalid-csrf-protection-token'  id=\"boomdevs_5\" class=\"wp-block-heading\" id=\"h-how-to-fix-an-invalid-csrf-protection-token\">How to fix an invalid CSRF protection token?<\/h3>\n\n\n\n<p>If a token has been compromised, you still can fix it. To do that:<\/p>\n\n\n\n<ul>\n<li>Open the Chrome settings;<\/li>\n\n\n\n<li>Click on&nbsp;<strong>Advanced&nbsp;<\/strong>on the bottom of the page;<\/li>\n\n\n\n<li>Click on the&nbsp;<strong>Content Settings<\/strong>&nbsp;in the&nbsp;<strong>Privacy and Security<\/strong>&nbsp;section;<\/li>\n\n\n\n<li>Press&nbsp;<strong>Cookies<\/strong>;<\/li>\n\n\n\n<li>Click&nbsp;<strong>Add&nbsp;<\/strong>next to&nbsp;<strong>Allow<\/strong>;<\/li>\n\n\n\n<li>Seek for&nbsp;<strong>todoist&nbsp;<\/strong>under&nbsp;<strong>All cookies and Site&nbsp;<\/strong>data. Delete all Todoist-related entries.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-1 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/www.cs-cart.com\/contact\">PREVENT CSRF ATTACKS WITH US<\/a><\/div>\n<\/div>\n\n\n\n<h2 id='what-do-cs-cart-users-say-about-csrf-attacks'  id=\"boomdevs_6\" class=\"wp-block-heading\" id=\"h-what-do-cs-cart-users-say-about-csrf-attacks\">What do CS-Cart users say about CSRF attacks?<\/h2>\n\n\n\n<p>Here is what users say on the CS-Cart forum about how they encountered the error message:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">Just tried to edit the name of a filter (in this case \u2018Designer\u2019). When I clicked Save &amp; Close I received the following error message \u2013 Error Access Denied: Possible CSRF Attack Detected \u2013 in the top right. It was in the CS-Cart box that usually displays \u2018upgrade available\u2019 etc.&nbsp;<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">When I select either Theme Editor or Edit content on site in Design \u2013 Themes, I get an error popup message \u201cError access denied: Possible CSRF attack\u201d and can\u2019t access these two facilities. (\u2026) Whilst they (hosts) were checking, they also upped the&nbsp;PHP version&nbsp;from 5.6 to 7.1 to speed things up, but I am still getting the CSRF error when selecting either Theme Editor or Edit content on site in Design \u2013 Themes.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">One of my customers told me that he got the \u201cErrorAccess denied: Potential CSRF attack detected\u201d message on trying to make an order. What is the cause and the solution to prevent this from happening again?<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">I\u2019ve just installed trial version for client to try before purchasing, but receiving the following error when trying to upload a banner: Access denied: Possible CSRF attack<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">I have been in the process of setting up more products for my website. I have had no such errors previously. When updating some pictures for the \u201coption combination\u201d tab, it takes me back to my dashboard and has this message in red \u201cErrorAccess denied: Possible CSRF attack\u201d. Anyone know this came up all of a sudden, and how to get rid of it?<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">I am having a huge problem with product option add. I have added 60 variants on a single option, although there are 60 more to add. But couldn\u2019t add anymore because after I hit the \u201cSAVE\u201d button, it redirects to the dashboard and says \u201cAction Denied : POSSIBLE CSRF ATTACK\u201d.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">I have enabled\/disabled the anti_csrf variable true\/false but in any case it is not working.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">Maybe you have some restrictions on your server.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">After I updated CS-Cart to version 4.3.4, I received an error Access denied: Possible CSRF attack, when I try to move some items from one category to another.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">Before I was moving more than 100 products at the same time, but now I receive this error when I move 30 products.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">I encountered the error Access Denied: CSRF Attack Possible\u201d when I tried to log in to my cart admin panel.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">Since upgrading to 4.11.5 if I try to do a bulk packing slip print. It opens the new window, but then takes me to the Dashboard and gives me the Error \u201cAccess denied: Possible CSRF attack\u201d. I\u2019ve cleared cache, logged out, restarted browser, etc. to no avail.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">We are trying to change shipping settings for a certain shipping method on our CS-Cart\u00a0<a href=\"https:\/\/www.cs-cart.com\/blog\/ecommerce-backend\/\">backend<\/a>\u00a0but it results in the \u201cerrorAccess denied: Possible CSRF attack\u201d message.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-medium-font-size\">My customer can\u2019t log in getting Denied: CSRF Attack. He is&nbsp; getting a message DENIED CSRF ATTACK using Internet Explorer trying to log in.<\/p>\n<\/blockquote>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-2 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/www.cs-cart.com\/contact\">RELY ON CS-CART EXPERTS<\/a><\/div>\n<\/div>\n\n\n\n<h2 id='reasons-behind-csrf-attack-messages-encountered-by-the-cs-cart-users'  id=\"boomdevs_7\" class=\"wp-block-heading\" id=\"h-reasons-behind-csrf-attack-messages-encountered-by-the-cs-cart-users\">Reasons behind CSRF attack messages encountered by the CS-Cart users<\/h2>\n\n\n\n<p>The most common reason for a CSRF-attack message appearing in the CS-Cart projects is the value of the&nbsp;<strong>max_input_vars&nbsp;<\/strong>PHP directive on the server. The server truncates the request and if the&nbsp;<strong>security_hash<\/strong>` parameter gets truncated, the error message appears.<\/p>\n\n\n\n<h3 id='how-to-fix-csrf-attack-messages'  id=\"boomdevs_8\" class=\"wp-block-heading\" id=\"h-how-to-fix-csrf-attack-messages\">How to fix CSRF attack messages?<\/h3>\n\n\n\n<ol>\n<li>If you have a&nbsp;VPS&nbsp;or dedicated server you should check the value of&nbsp;<strong>max_post_size<\/strong>&nbsp;and&nbsp;<strong>max_input_vars<\/strong>. Increase both of them until you no longer see that error. The same settings are applicable to shared hosting but they are under control of the hosting provider. Ask the host to change them and if they won\u2019t \u2013 hop to another host.<\/li>\n\n\n\n<li>If you do not have access to the settings, create a php.ini file and adjust there.<\/li>\n\n\n\n<li><\/li>\n<\/ol>\n\n\n\n<p>The values should be as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>upload_max_filesize =&nbsp;10M\npost_max_size =&nbsp;10M\nmax_input_vars =&nbsp;10000<\/code><\/pre>\n\n\n\n<p>You can add&nbsp;<strong>php_value max_input_vars 1000<\/strong>&nbsp;to .<strong>htaccess&nbsp;<\/strong>file. To verify that the new setting is active, create a PHP test file that contains the following code in the root directory of your store:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>&lt;?php phpinfo();<\/strong><\/code><\/pre>\n\n\n\n<p>Also you can find&nbsp;<strong>max_input_vars&nbsp;<\/strong>in&nbsp;<strong>php.ini<\/strong>&nbsp;file and change the value.<\/p>\n\n\n\n<ol start=\"3\">\n<li>Try clearing the cookies for your site. CSRF messages are triggered when the session keys don\u2019t match the cookies.<\/li>\n<\/ol>\n\n\n\n<p>After you clean cookies, you can also try incognito mode in Chrome or Private Window in IE\/Edge.<\/p>\n\n\n\n<ol start=\"4\">\n<li>Sometimes, the Access denied: Possible CSRF attack message appears when your customers bookmark a URL that expects a SESSION key instead of the homepage of the site where a SESSION key is generated. In this case, customers should replace their bookmarks with the homepage URL.<\/li>\n<\/ol>\n\n\n\n<h3 id='debriefing-some-of-the-remedies-against-csrf-errors'  id=\"boomdevs_9\" class=\"wp-block-heading\" id=\"h-debriefing-some-of-the-remedies-against-csrf-errors\">Debriefing some of the remedies against CSRF errors<\/h3>\n\n\n\n<h4 id='increasing-the-value-of-the-max-input-vars-php-directive-to-10000-or-more'  id=\"boomdevs_10\" class=\"wp-block-heading\" id=\"h-increasing-the-value-of-the-max_input_vars-php-directive-to-10000-or-more\">Increasing the value of the max_input_vars PHP directive to 10000 or more.<\/h4>\n\n\n\n<p>The most common way to get rid of that kind of message and fix the problem is to increase the&nbsp;<strong>max_input_vars<\/strong>. The max_input_vars directive helps the web application truncate the request. In that case, when the attacker tries to send a big request to your CS-Cart project, it can crash or take down your webserver (DoS attack).<\/p>\n\n\n\n<p>By default, this PHP directive is set to&nbsp;<strong>1000<\/strong>. 1000 means one thousand form fields sent in one request. You cannot send more if such limitation is set. Customers on our hosting benefit from a&nbsp;<strong>5000&nbsp;<\/strong>value and we bear all the risks of such an increase.<\/p>\n\n\n\n<p>Increasing the<strong>&nbsp;max_input_vars<\/strong>&nbsp;directive is a dangerous modification. And if you do change this directive to&nbsp;<strong>10000&nbsp;<\/strong>or&nbsp;<strong>20000&nbsp;<\/strong>on your own, it is recommended to roll back this modification or consult your hosting provider or the CS-Cart team for proper configuration..<\/p>\n\n\n\n<h4 id='disabling-anti-csrf'  id=\"boomdevs_11\" class=\"wp-block-heading\" id=\"h-disabling-anti_csrf\">Disabling anti_csrf<\/h4>\n\n\n\n<p>You can disable the<strong>&nbsp;<a href=\"https:\/\/www.invicti.com\/blog\/web-security\/protecting-website-using-anti-csrf-token\/\" target=\"_blank\" rel=\"noreferrer noopener\">anti_csrf tweak<\/a><\/strong>&nbsp;at the config.local.php file as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-opt-id=1371715952  fetchpriority=\"high\" decoding=\"async\" width=\"784\" height=\"183\" src=\"https:\/\/mldi5dmmdvnt.i.optimole.com\/cb:sOwt.3b410\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/www.cs-cart.com\/blog\/wp-content\/uploads\/possible-csrf-attack1.png\" alt=\"Disabling anti_csrf tweak in CS-Cart\" class=\"wp-image-23521\" srcset=\"https:\/\/mldi5dmmdvnt.i.optimole.com\/cb:sOwt.3b410\/w:784\/h:183\/q:mauto\/f:best\/https:\/\/www.cs-cart.com\/blog\/wp-content\/uploads\/possible-csrf-attack1.png 784w, https:\/\/mldi5dmmdvnt.i.optimole.com\/cb:sOwt.3b410\/w:300\/h:70\/q:mauto\/f:best\/https:\/\/www.cs-cart.com\/blog\/wp-content\/uploads\/possible-csrf-attack1.png 300w, https:\/\/mldi5dmmdvnt.i.optimole.com\/cb:sOwt.3b410\/w:768\/h:179\/q:mauto\/f:best\/https:\/\/www.cs-cart.com\/blog\/wp-content\/uploads\/possible-csrf-attack1.png 768w, https:\/\/mldi5dmmdvnt.i.optimole.com\/cb:sOwt.3b410\/w:400\/h:93\/q:mauto\/f:best\/https:\/\/www.cs-cart.com\/blog\/wp-content\/uploads\/possible-csrf-attack1.png 400w\" sizes=\"(max-width: 784px) 100vw, 784px\" \/><figcaption class=\"wp-element-caption\">Disabling anti_csrf tweak<\/figcaption><\/figure>\n\n\n\n<p>Although, we do NOT recommend this remedy as there are more secure approaches, in most cases, this protection is enough.&nbsp;<\/p>\n\n\n\n<h2 id='closing'  id=\"boomdevs_12\" class=\"wp-block-heading\" id=\"h-closing\">Closing<\/h2>\n\n\n\n<p>CSRF attacks can ruin your business making sensitive data available to attackers and shutting down the work of the whole application. The CS-Cart team has extensive experience resolving such issues, providing safe configuration, performance optimization, and custom development solutions to strengthen your eCommerce project.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-3 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/www.cs-cart.com\/contact\">RELY ON CS-CART EXPERTS<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"CSRF attacks can make your site vulnerable in front of malicious users. They are dangerous as when your&hellip;","protected":false},"author":84973,"featured_media":23527,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_ayudawp_aiss_exclude":false,"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[6,5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.cs-cart.com\/blog\/wp-json\/wp\/v2\/posts\/23520"}],"collection":[{"href":"https:\/\/www.cs-cart.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cs-cart.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cs-cart.com\/blog\/wp-json\/wp\/v2\/users\/84973"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cs-cart.com\/blog\/wp-json\/wp\/v2\/comments?post=23520"}],"version-history":[{"count":6,"href":"https:\/\/www.cs-cart.com\/blog\/wp-json\/wp\/v2\/posts\/23520\/revisions"}],"predecessor-version":[{"id":24097,"href":"https:\/\/www.cs-cart.com\/blog\/wp-json\/wp\/v2\/posts\/23520\/revisions\/24097"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cs-cart.com\/blog\/wp-json\/wp\/v2\/media\/23527"}],"wp:attachment":[{"href":"https:\/\/www.cs-cart.com\/blog\/wp-json\/wp\/v2\/media?parent=23520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cs-cart.com\/blog\/wp-json\/wp\/v2\/categories?post=23520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cs-cart.com\/blog\/wp-json\/wp\/v2\/tags?post=23520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}