# SSRF in tool_trigger HTTP action: raw Guzzle bypasses Moodle's curl_security_helper
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 15/100
Direzione di ricerca
Start in classes/steps/actions/http_post_action_step.php, at get_http_client() and where the outbound request is built. The fix touches the HTTP client choice and destination validation, which needs maintainer agreement on approach and an answer on whether the report should be handled privately first. Done means outbound HTTP action requests pass the same destination checks as Moodle's curl wrapper, with tests for blocked targets.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- Project: catalyst/moodle-tool_trigger — https://github.com/catalyst/moodle-tool_trigger
- CWE: CWE-918 (Server-Side Request Forgery)
- ASVS: V12 Files & Resources (SSRF) / V5
- Reviewed at: default branch HEAD
3ef42fd, full clone 2026-10-05 - Severity: Medium — non-blind SSRF reachable by a
manager-level user
(below site admin), can reach internal/cloud-metadata endpoints and read
responses. - Status: candidate — static; not dynamically reproduced. Not disclosed.
Summary
tool_trigger runs admin/manager-defined workflows (event → conditions → action
steps). The HTTP action step issues the outbound request with a raw
GuzzleHttp\Client, not Moodle's \curl wrapper:
// classes/steps/actions/http_post_action_step.php
public function get_http_client() {
$clientconfig = [];
if ($this->httphandler) {
$clientconfig['handler'] = $this->httphandler;
}
return new \GuzzleHttp\Client($clientconfig); // no SSRF protection
}
...
$url = $this->render_datafields($this->url, null, null, $urlencodecallback);
$request = new \GuzzleHttp\Psr7\Request($this->httpmethod, $url, $headers, $params);
$client = $this->get_http_client();
// ... response is sent, and its body captured into stepfields (below)
Moodle's \curl class routes requests through curl_security_helper, which (by
default) blocks requests to loopback, RFC1918, link-local and the cloud
metadata ranges — this is Moodle's standard SSRF defence, and plugins are
expected to use \curl precisely for this reason. Guzzle applies none of it, so
the target host is unrestricted.
Why it matters (privilege boundary + non-blind)
- Reachable by
manager, not just admin. The gating capability
tool/trigger:manageworkflowsis granted to themanagerarchetype
(db/access.php). Managers are a delegable Moodle role with broad application
power but no infrastructure/network access — SSRF lets them pivot the
server to reach the internal network and cloud metadata service
(http://169.254.169.254/latest/meta-data/iam/security-credentials/…),
crossing from the Moodle admin plane into the hosting/infra plane (potential
cloud IAM credential theft). - Non-blind. The step declares
http_response_status_code,
http_response_status_messageandhttp_response_bodyas stepfields
($stepfields), so the fetched response is captured and available to
subsequent steps / run history — the attacker can read the internal
response, not merely trigger a blind request. - Datafield substitution +
urlencodecallback on substituted values prevents an
event-data value from changing the URL host, so the SSRF is via the
workflow's configured URL (manager-controlled), not via a lower-privileged
user's event data. The boundary crossed is manager → infra.
Impact
A system-level manager can exfiltrate internal-only HTTP services and cloud
metadata (including, in common AWS/GCP/Azure setups, instance IAM credentials)
through the Moodle server, and read the responses — without any site-admin or
shell access.
Remediation
- Issue the request through Moodle's
\curlclass (which applies
curl_security_helper) instead of a raw Guzzle client; or, if Guzzle is
required, validate the resolved target against
\core\files\curl_security_helper(or an equivalent host/IP allowlist that
blocks loopback/RFC1918/link-local/metadata) before sending, and re-check
on each redirect hop. - Consider an admin-managed allowlist of permitted destination hosts for HTTP
action steps, given the capability is manager-delegable.
Scope notes
- Other action steps reviewed at a glance:
role_assign/assign_cohort/
webservice_actiongrant roles/call services as part of workflows — all gated
by the samemanageworkflowscapability (manager). Worth a deeper pass for
whether a workflow can assign a role at a context the manager couldn't
otherwise reach (privilege-escalation-via-automation) — not completed here,
flagged in the coverage note.
Limitations / not done
- Not dynamically reproduced (needs a running Moodle + a manager account + a
configured workflow). Static read of the action step, capability, and client
construction. - Confirm
curl_security_helperis enabled by default on the target Moodle
version (it is, on current supported versions) when writing the report.
- Lingua principale
- PHP
- Stelle
- 46
- Fork
- 29
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di catalyst/moodle-tool_trigger
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 45/100
catalyst/moodle-tool_trigger#251 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
catalyst/moodle-tool_trigger#249 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
catalyst/moodle-tool_trigger#248 ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
catalyst/moodle-tool_trigger#243 ·
-
convert unix timeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 38/100
catalyst/moodle-tool_trigger#239 ·
Tutte le issue di catalyst/moodle-tool_trigger
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
taskforcesh/bullmq#5238 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects itForse già presa @bfs2021 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Automattic/jetpack#55517 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
-
area/import type/enhancement when/later
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno