Recently we received a request from a client: their MODX site suddenly started redirecting visitors to phishing pages. During diagnostics we found that in a custom snippet $_GET['id'] was not escaped, allowing an attacker to inject SQL. Standard MODX protection (tokens, hashes) didn't help – the vulnerability was in the application layer. Such cases are not rare: according to OWASP, 70% of CMS hacks occur due to errors in custom code. Outdated extras (e.g., FormLister), incorrect permissions on core/, open /manager/ without IP restrictions – typical issues we find in nearly every third project. The total damage from a hack for small businesses can be significant, including data recovery and reputation. Manual audit detects 2–3 times more vulnerabilities than automated scanners and provides context for proper fixes. Get a MODX security audit to avoid such situations.
We have been conducting MODX site audits for over 5 years. During this time we have analyzed more than 120 projects – from small landing pages to large corporate portals. We guarantee that after our check you will receive a concrete list of vulnerabilities and recommendations for their elimination. On average, we find 12–15 vulnerabilities of varying criticality per project, with 80% related to outdated components. Fixing critical vulnerabilities typically saves significant costs on post-hack recovery. Comparison with automated scanners: manual analysis is 3 times more effective for detecting business logic vulnerabilities.
Why Outdated Extras Threaten Security?
Outdated plugins are one of the main causes of hacks. For example, FormLister (versions before 0.8.3) contains a vulnerability that allows arbitrary code execution. Replacing it with FormIt reduces the probability of RCE attacks by 70% – we observe this improvement in 90% of projects after an audit.
| Extra | Status | Recommendation |
|---|---|---|
| FormLister | Outdated, RCE vulnerabilities | Replace with FormIt |
| Ajaxform | Outdated | Use pdoTools or custom |
| miniShop2 | Current, requires configuration | Update to latest version |
| Tickets | Outdated | Replace with modExtra or Tickets 2.0 |
How to Protect Custom Code from SQL Injections?
We scan all snippets, plugins, and modules for direct SQL queries without escaping. We use grep and static analysis. According to Wikipedia, SQL injection is one of the most common vulnerabilities, and all database queries should be executed through $modx->query() or $modx->newQuery().
The key rule: never pass unescaped $_GET or $_POST into a query. Example vulnerability:
// Bad: SQL Injection $id = $_GET['id']; $result = $modx->query("SELECT * FROM modx_site_content WHERE id = $id"); // Good: escaping $id = (int)$_GET['id']; $result = $modx->getObject('modResource', $id); Additionally, we check if $modx->db->query() is used directly – this error occurs in 60% of custom snippets. We recommend always using getObject or newQuery with parameter binding.
How to Protect the MODX Manager Panel?
Restrict /manager/ by IP – the most reliable method. If not possible, enable two-factor authentication (MODX supports TOTP via extra). Also mandatory:
-
session_cookie_secure = 1(HTTPS only) -
session_cookie_httponly = 1 -
session_cookie_samesite = Strict - Limit failed login attempts:
failed_login_attempts = 5,blocked_minutes = 60
Example Nginx configuration:
location /manager/ { allow 192.168.1.0/24; deny all; } According to our statistics, 70% of MODX hacks occur through password guessing on /manager/. Setting a limit on attempts reduces the risk of brute force by 10 times.
How We Conduct the Audit: Stack and Process
We use both automated scanners and manual analysis. Main tools:
- Scanning: Nikto, ffuf (for hidden files), WPScan (adapted for MODX)
- Configuration analysis: file permissions, MODX system settings, HTTP headers
- Code audit: grep for
$_GET,$_POST,$db->query()in custom components - Version check: match Extra list against vulnerability database (CVE)
Process steps:
- Diagnostics (1 hour): gather information about MODX version, installed Extras, PHP version, server settings.
- Scanning (2 hours): automated search for common vulnerabilities, directory scanning.
- In-depth analysis (4 hours): manual check of custom code, configuration files, access rights.
- Report (2 hours): document each found vulnerability with criticality level, step-by-step recommendations for fixing.
Total time: 1 to 3 days depending on the amount of custom code.
| Setting | Recommended Value |
|---|---|
| session_cookie_secure | 1 |
| session_cookie_httponly | 1 |
| session_cookie_samesite | Strict |
| failed_login_attempts | 5 |
| blocked_minutes | 60 |
| use_editor | 1 (with restricted rights) |
Example of additional checks
We also test for Local File Inclusion (LFI) vulnerabilities and check if an outdated PHP version is used (e.g., 7.4, which no longer receives security patches). The full list of checks is included in the audit report.
What Is Included in the Result
Upon completion you receive:
- A report with detailed description of found vulnerabilities (screenshots, evidence)
- Recommendations for fixing with priorities
- Fixing of critical issues (upon agreement)
- Documentation for hardening Nginx/Apache and MODX configuration
- Secure development checklist for your team
- Re-scan after vulnerability remediation (on request)
Contact us for a preliminary assessment of your project – we will provide exact timelines and cost after a quick free diagnostics.
Deadlines and Cost
An audit takes from 1 day (standard) to 3 days (comprehensive with custom code). Cost is calculated individually, depends on the volume of Extras checked and the number of lines of code in custom modules. Fixing identified vulnerabilities takes from 4 to 16 hours depending on complexity. Get a consultation on the security audit of your MODX site.
Checklist for Self-Check (Typical Mistakes)
- The
corefolder must not be in the web-root. -
config.core.phpmust not be accessible via browser. - The
setup/folder must be removed. - All Extras are up to date.
- Permissions on
assets/folder – no PHP execution. -
session_cookie_secureandhttponlyenabled. - Access to
/manager/restricted. - Custom code checked for SQL injections.
Order a MODX security audit today and protect your site from hacking.







