Support

Admin Tools

#41666 Security Alert from Admin Tools – API Access Issue

Posted in ‘Admin Tools for Joomla! 4 & 5’
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.2.3
PHP version
8.2
Admin Tools version
7.6.2

Latest post by [email protected] on Thursday, 27 February 2025 10:11 CST

[email protected]

Hello,

I have received several alerts from Admin Tools notifying me of the following error:

Exception Type: Joomla\CMS\Application\Exception\NotAcceptable
File: /home/village/public_html/libraries/src/Application/ApiApplication.php
Line: 271
Message: Could not match accept header

#0 /home/village/public_html/libraries/src/Application/ApiApplication.php(110): Joomla\CMS\Application\ApiApplication->route()
#1 /home/village/public_html/libraries/src/Application/CMSApplication.php(306): Joomla\CMS\Application\ApiApplication->doExecute()
#2 /home/village/public_html/api/includes/app.php(50): Joomla\CMS\Application\CMSApplication->execute()
#3 /home/village/public_html/api/index.php(31): require_once('/home/village/p...')
#4 {main}

Additionally, in the SERVER variables (among others), I noticed:

[REQUEST_URI] => /api/shared/config/config.env
[REDIRECT_URL] => /api/shared/config/config.env

Since I assume this is an attack and it happens frequently, could you please advise if I can add something to the Admin Tools Professional configuration or .htaccess to protect against it?

Note: I use Akeeba Backup automated via command-line CRON jobs.

Thank you.

José Luis Martínez

 

nicholas
Akeeba Staff
Manager

TL;DR: There is nothing to worry about, but you can of course block this request with a .htaccess rule.

Joomla's API application expects to see an Accepts header with specific content types when you're making a legitimate API request. If this header is missing completely, or when it does not like its contents, it will immediately throw the Joomla\CMS\Application\Exception\NotAcceptable exception, blocking the request.

Even if that wasn't the case, the Joomla API application will then proceed to check the Authorization header for the (very secure) Joomla API access token. This is a very secure token. The token is never stored verbatim anywhere. Its two seeds are stored one in the database, and the other one in the filesystem. They are combined at runtime to create the token right before it's compared (with a time-safe string comparison function) to the provided token. I wrote that code myself, and it was audited by the most experienced core contributors. Since the attacker won't know this token their request will be blocked.

Even if they somehow have a valid token, it needs to be a Super User token. The only way to get that information is, basically, to have already completely compromised your site. I am talking about a complete filesystem and database dump. Clearly, if that was the case they wouldn't be making a stupid API call which is bound to fail, so that's not a concern.

The next thing the Joomla API application does is check the route, the stuff after /api. The route shared/config/config.env is invalid, so it would at best result in a 404 error and that's if the attacker already had a Super User token, i.e. if they had already compromised your site.

So, no, this is nothing to worry about. It's a script kiddie doing something bound to fail.

If you want, you can of course create a .htaccess rule to block any URL starting with /api/shared/config just like so:

RewriteRule ^api/shared/config/ - [F,L]

Add it to the rules to add at the top of the file.

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!

[email protected]

Thanks a lot Nicholas for your fast and complete answer. I have added the rule to the .htaccess file as you suggested.

Best regards,

José Luis Martínez

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!