Menu

Moodle cron from the browser is a leftover attack surface
📰

Moodle cron from the browser is a leftover attack surface

DEV Community: php·Luuk Verhoeven·about 8 hours ago
#eqPHfZE9
#devto#dev#cron#admin#moodle
Reading 0:00
15s threshold

Moodle™ still ships a web entry for scheduled tasks: /admin/cron.php . Operators who upgraded the code and left the vhost alone still have it. The homepage can look fine. Cron from a browser is a different question.

The setting that closes it is $CFG->cronclionly . The proof is a GET from the public hostname, not a tick on the scheduled-tasks screen.

What the web cron actually is

Scheduled tasks and ad-hoc tasks are how Moodle sends mail, cleans sessions, processes course backups, pulls calendar events, and runs plugin jobs. CLI is the supported way:

php admin/cli/cron.php # or, on 5.1 with the public/ restructure, from $CFG->root: php public/admin/cli/scheduled_task.php --list | head

Enter fullscreen mode

Exit fullscreen mode

/admin/cron.php is the old web wrapper. It runs the same work if the request is allowed. It is not a health check. It is execution.

A GET that returns 200 with Moodle's cron output means anyone who can reach the hostname can kick the job runner.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.