Skip to content

Public accessibility of cron.php causes errors and security concerns #40190

@Gurdit

Description

@Gurdit

Preconditions and environment

Magento / Adobe Commerce 2.4.8

Steps to reproduce

  1. Install Magento 2
  2. Open a browser and navigate to https://yourdomain.com/cron.php.

Expected result

  1. cron.php should not be publicly accessible in a production environment.
  2. Magento cron jobs should only run via CLI (bin/magento cron:run) and system cron tasks.

Actual result

  1. cron.php is exposed to the web by default.
  2. If executed via HTTP, it can cause runtime errors, e.g.:
    TypeError: implode(): Argument #1 ($array) must be of type array, string given in /app/bvu7cj4frt2um/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php:967

Additional information

  • cron.php exposure appears to be a legacy carryover from Magento 1, where web crons were common on shared hosting.
  • Current Adobe Commerce documentation recommends system-level CLI cron only (bin/magento cron:run).
  • Executing cron.php via HTTP can cause errors (e.g. implode(): Argument Can you commit to repository a folder dev/tests/static ? #1 ($array) must be of type array, string given) and may unnecessarily increase the attack surface.
  • In modern deployments, cron.php is not required, but its presence in pub/ causes confusion about best practices.
  • Clarification is needed whether this file should be considered deprecated or officially supported.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Issue: needs updateAdditional information is require, waiting for responseReported on 2.4.8Indicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

Status

Needs Update

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions