moodle-external-api-development

Fail

Audited by Gen Agent Trust Hub on Sep 15, 2026

Risk Level: HIGHPRIVILEGE_ESCALATIONCOMMAND_EXECUTIONDATA_EXFILTRATIONINDIRECT_PROMPT_INJECTION
Full Analysis
  • [PRIVILEGE_ESCALATION]: In SKILL.md (Step 6), the provided PHP example uses mkdir($logdir, 0777, true) to create a log directory. Using 0777 permissions makes the directory world-writable and world-readable, allowing any user on the system to access, modify, or delete the log files, which is a security risk in shared or multi-user environments.
  • [DATA_EXFILTRATION]: The logging implementation in SKILL.md (Step 6) records sensitive system data, specifically the last executed SQL query via $DB->get_last_sql() and the full execution stack trace via $e->getTraceAsString(). Combined with world-writable directory permissions, this exposes internal database logic and code structures to unauthorized users.
  • [COMMAND_EXECUTION]: The testing section in SKILL.md includes curl command examples that handle sensitive credentials such as passwords and authentication tokens as plaintext command-line arguments. This practice can lead to the exposure of credentials in shell history logs.
  • [INDIRECT_PROMPT_INJECTION]: The skill facilitates the creation of APIs in SKILL.md that ingest external data (e.g., userid, courseid). 1. Ingestion points: The execute method processes external parameters. 2. Boundary markers: The guide utilizes Moodle's validate_parameters but lacks explicit instructions to ignore embedded commands in the processed data. 3. Capability inventory: The skill uses database operations ($DB) and file system operations (mkdir, file_put_contents). 4. Sanitization: Input is filtered using Moodle's PARAM_INT and PARAM_TEXT types.
Recommendations
  • AI detected serious security threats
Audit Metadata
Risk Level
HIGH
Analyzed
Sep 15, 2026, 03:19 PM