moodle-external-api-development

Warn

Audited by Gen Agent Trust Hub on Nov 10, 2026

Risk Level: MEDIUMPRIVILEGE_ESCALATIONDATA_EXFILTRATIONINDIRECT_PROMPT_INJECTION
Full Analysis
  • [PRIVILEGE_ESCALATION]: The skill's logging example implementation in SKILL.md uses mkdir($logdir, 0777, true), which creates directories with world-writable permissions. This is an insecure permission setting that could allow unauthorized local users to manipulate files within the application's data directory.
  • [DATA_EXFILTRATION]: The suggested error handling logic in SKILL.md logs sensitive system data, such as SQL queries via $DB->get_last_sql() and stack traces via $e->getTraceAsString(), to local log files. This poses a risk of exposing the database schema and application structure to unauthorized parties if the log files are discovered or accessed.
  • [INDIRECT_PROMPT_INJECTION]: The skill defines patterns for creating APIs that ingest external parameters, creating a surface for potential injection attacks where malicious input could influence downstream agent actions.
  • Ingestion points: API input parameters defined in execute_parameters() within SKILL.md.
  • Boundary markers: Encourages the use of validate_parameters() and validate_context() to delimit input and check authorization.
  • Capability inventory: Code examples involve database manipulation (insert_record, get_records_sql) and course module management (add_course_module).
  • Sanitization: Recommends using Moodle's PARAM_* cleaning constants and parameterized SQL queries to mitigate common injection vectors.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Nov 10, 2026, 03:34 PM