Summary
Craft CMS 5.9.5 and earlier exposes the /actions/app/migrate endpoint without enforcing proper authorization checks.
Under certain deployment conditions, an attacker who can reach this endpoint may be able to trigger application migrations, potentially altering the database schema or application state without valid permissions.
Affected context
This vulnerability affects Craft CMS installations (5.9.5 and earlier) where the /actions/app/migrate endpoint is reachable from untrusted networks or users.
It is most relevant in environments where control-panel or action endpoints are exposed beyond tightly controlled admin access, or where reverse-proxy and routing rules do not adequately restrict sensitive application actions.
The risk increases when deployments run with elevated database privileges and migrations can materially change schema, data, or system configuration.
Exploit preconditions
- Attack surface: HTTP(S) endpoint
/actions/app/migrateon the Craft CMS application. - Required access: Network access to the vulnerable Craft CMS instance; no valid authentication or specific role is reliably enforced by the endpoint.
- Trigger point: Sending crafted requests to the migrate endpoint to invoke migration logic.
- Why exploitation is possible: The endpoint does not consistently verify that the caller is an authenticated and authorized administrative user before executing migration-related operations, violating least-privilege and access-control expectations.
Why this happens
The underlying issue is a missing authorization control on a sensitive operation endpoint, mapping directly to CWE-862: Missing Authorization.
The migration action is exposed as a web-accessible route but fails to enforce robust checks that the requester holds an appropriate administrative role or permission.
Instead of treating migration execution as a privileged backend operation restricted to trusted workflows (e.g., CLI, authenticated admin UI), the implementation allows calls without sufficient verification, creating an insecure access-control pattern.
Potential impact
- An attacker could trigger database migrations without proper authorization.
- Unauthorized schema or data changes may be applied, potentially leading to data corruption or loss.
- Application integrity could be affected if migrations alter configuration, enable/disable features, or introduce inconsistent state.
- In some configurations, unauthorized migrations may facilitate further compromise by weakening security-related structures or controls.
General mitigation guidance
Effective mitigation focuses on enforcing strict authorization and reducing exposure of sensitive endpoints:
- Require explicit authentication and role/permission checks for all administrative and migration-related actions.
- Restrict access to system action endpoints (such as migration routes) to trusted networks or VPNs, limiting public internet exposure.
- Prefer command-line or deployment-pipeline driven migration workflows that run out-of-band from public web traffic.
- Apply least-privilege principles to the database account used by the application, so that even if the endpoint is misused, the scope of schema and data changes is constrained.
- Document and regularly review security-sensitive routes to ensure they are not unintentionally exposed or unauthenticated.
How teams detect issues like this
Organizations can identify and monitor this class of issue using a mix of review and tooling:
- Perform code review focusing on routes that perform migrations, configuration changes, or database-altering operations, verifying they enforce authentication and authorization.
- Use application security testing (DAST) to probe for sensitive endpoints that respond successfully without authentication.
- Configure web server or WAF rules to log and alert on access to migration or system action endpoints, especially from untrusted IP ranges.
- Employ static analysis or custom linting rules that flag controller actions or routes lacking explicit access-control checks.

