# Moodle security audit

> Moodle security audit is an open-source agent skill for security. Audits Moodle plugin code for security issues and gives fix patterns. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/SaadRahman01/claude-moodle-dev/tree/main/skills/moodle-security-audit
- **Repository:** https://github.com/saadrahman01/claude-moodle-dev
- **GitHub stars:** 44
- **License:** MIT
- **Skill name:** moodle-security-audit
- **Collection:** https://github.com/SaadRahman01/claude-moodle-dev
- **Categories:** [security](https://ai-powered.com/categories/security), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill guides an agent through reviewing or hardening Moodle plugin code. It walks through a fixed checklist for every entry script: login, context, capability, sesskey, and typed parameter handling, in that order. It then covers the common Moodle vulnerability classes, including SQL placeholders, output escaping, pluginfile callbacks, external HTTP via the core curl wrapper, uploads, secrets storage, logging, and open redirects.

The skill is organized as a set of bad-versus-good code examples and an anti-pattern table that maps each mistake to its Moodle replacement. It also points to phpcs with the Moodle code checker as a static analysis step, and explains that suspected core vulnerabilities should be reported privately to Moodle's security team rather than in a public issue.

It expects a Moodle plugin codebase in PHP and mustache templates, with the Moodle APIs available. It does not include scripts; the agent works from the instructions and the code it is given.

## When your agent uses it

> Use when reviewing or hardening Moodle plugin code for security — capability checks, sesskey CSRF, input validation, SQL injection, XSS, file serving, SSRF, IDOR, secrets handling, and Moodle's specific anti-patterns.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/SaadRahman01/claude-moodle-dev/tree/HEAD/skills/moodle-security-audit)
- [License: MIT](https://github.com/SaadRahman01/claude-moodle-dev/tree/HEAD/skills/moodle-security-audit)

## Features

- **Entry script checklist:** A fixed order of login, context, capability, sesskey, and typed input checks for every entry point.
- **IDOR and capability review:** Guidance to derive the context from the object being acted on rather than from URL parameters.
- **SQL injection prevention:** Placeholder and get_in_or_equal patterns, plus safe LIKE handling for search inputs.
- **Output escaping rules:** Which Moodle functions to use for escaping, and how Mustache escaping differs from raw output.
- **File serving and uploads:** Checks for pluginfile callbacks and draft-area upload handling with type and size limits.
- **Anti-pattern reference table:** A quick table mapping common insecure Moodle code to its recommended replacement.

## Good for

- Review a Moodle plugin pull request for security problems
- Check a local plugin's AJAX endpoints for missing login and sesskey checks
- Find SQL concatenation and replace it with placeholders
- Audit a pluginfile callback for missing capability checks
- Respond to a vulnerability report against a Moodle plugin

## Install

### Claude Code

This skill ships in the `moodle-dev` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add SaadRahman01/claude-moodle-dev
/plugin install moodle-dev@moodle-dev
```

Or copy only this skill to `~/.claude/skills/moodle-security-audit`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/moodle-security-audit &&
cp -R "$tmp/skills/moodle-security-audit" ~/.claude/skills/moodle-security-audit &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/moodle-security-audit` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/moodle-security-audit` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/moodle-security-audit &&
cp -R "$tmp/skills/moodle-security-audit" ~/.agents/skills/moodle-security-audit &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/moodle-security-audit` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/moodle-security-audit` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/moodle-security-audit &&
cp -R "$tmp/skills/moodle-security-audit" ~/.cursor/skills/moodle-security-audit &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/moodle-security-audit` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/SaadRahman01/claude-moodle-dev.git --path skills/moodle-security-audit
```

Or copy the folder to `~/.gemini/skills/moodle-security-audit` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/moodle-security-audit`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/moodle-security-audit &&
cp -R "$tmp/skills/moodle-security-audit" ~/.copilot/skills/moodle-security-audit &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/moodle-security-audit` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git
```

Then copy `claude-moodle-dev/skills/moodle-security-audit` into your agent's skills folder as `moodle-security-audit`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Moodle security audit trigger?

When reviewing or hardening Moodle plugin code for security, covering capability checks, CSRF, input validation, SQL injection, XSS, file serving, SSRF, IDOR, secrets, and Moodle-specific anti-patterns.

### Does Moodle security audit run any scripts or tools?

No scripts are included. It recommends running phpcs with the Moodle code checker as a static analysis step.

### Where should I report a vulnerability found in Moodle core?

The skill says not to open a public issue and to email security@moodle.org under the Moodle security policy.

### Which Moodle skill should I read first if I am writing new code?

The skill says to use moodle-plugin-development for new feature code, since it covers the basics.

### How do I install Moodle security audit in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/moodle-security-audit to use it in all your projects, or to .claude/skills/moodle-security-audit in one project. Or install the moodle-dev plugin, which includes it: /plugin marketplace add SaadRahman01/claude-moodle-dev, then /plugin install moodle-dev@moodle-dev.

### Does Moodle security audit run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Moodle security audit?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Moodle security audit?

The closest alternatives to Moodle security audit are Moodle plugin development, Moodle accessibility, Security review, Moodle upgrade migration and Security review.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Moodle plugin development](https://ai-powered.com/skills/moodle-plugin-development): Moodle plugin development is an open-source agent skill for developer tools.
- [Moodle accessibility](https://ai-powered.com/skills/moodle-accessibility): Moodle accessibility is an open-source agent skill for developer tools.
- [Security review](https://ai-powered.com/skills/security-review-getsentry): Security review is an open-source agent skill for security.
- [Moodle upgrade migration](https://ai-powered.com/skills/moodle-upgrade-migration): Moodle upgrade migration is an open-source agent skill for developer tools.
- [Security review](https://ai-powered.com/skills/security-review-nabwinsaud): Security review is an open-source agent skill for security.
- [Security](https://ai-powered.com/skills/security-xiaolai): Security is an open-source agent skill for security.
- [Moodle performance](https://ai-powered.com/skills/moodle-performance): Moodle performance is an open-source agent skill for developer tools.
- [Security review edho ferdian](https://ai-powered.com/skills/security-review-edho-ferdian): Security review edho ferdian is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/moodle-security-audit
