A quiz IDOR, seen from an MCP server
ContenidoContents
On 20 November 2026 Moodle published two serious security advisories about the quiz (mod_quiz). Both affect web services. In both cases, a teacher could change things on a quiz they did not have permission to manage.
That is an IDOR: the API accepts an object identifier — here, a quiz or an override — and does not check, in the context of that activity, that the caller is allowed to manage it.
The advisories are MSA-26-0061 and MSA-26-0062. I link to the official list because that is where the wording, the severity, the versions and the CVE live.
What the advisories say
MSA-26-0061, CVE-2026-133074: extra checks were needed in a quiz overrides web service. A teacher could modify user or group overrides belonging to quizzes they did not have permission to manage. It affects 5.3, 5.2 to 5.2.4, 5.1 to 5.1.8, 4.5 to 4.5.15 and earlier unsupported versions. It is fixed in 5.3.1, 5.2.5, 5.1.9 and 4.5.16.
MSA-26-0062, CVE-2026-133075: the same kind of gap in a quiz random question filter web service. A teacher could change those settings on quizzes that were not theirs to manage. This advisory does not list 5.2 or 5.3: it affects 5.1 to 5.1.8, 4.5 to 4.5.15 and earlier unsupported versions. It is fixed in 5.1.9 and 4.5.16.
The fixed versions were released on 12 November. The advisories followed on the 20th.
The same day Moodle also published MSA-26-0059, another serious quiz advisory, this time about editing sections. Here I stay with the two that point at web services.
Why I care
I have already written about the quiz: a course ended up with 7.5 million duplicate questions. That was about volume, and about a context that had been misunderstood. This is about a permission that was not checked.
I am building local_mcpserver, a local plugin that turns Moodle into something any MCP-compatible client or assistant — from Anthropic, OpenAI, xAI or any other — can talk to directly. I wrote about it in I built myself an MCP server for Moodle. The assistant does not come in as a superuser. It signs in as a real user of the site, with what that user can already do in the interface.
If a core web service forgets to ask whose quiz this is, the omission is not limited to a classic integration. Any client that talks to those web services — a script, an app, or an MCP server that calls them — inherits the hole. The assistant does not invent permissions. It uses whatever Moodle lets through.
How my server signs in
local_mcpserver does not call those quiz web services. I wrote the quiz tools myself, on top of Moodle’s internal API. That does not make me cleverer. It means I have to perform the checks the core should have performed in those services.
The request arrives at {wwwroot}/local/mcpserver/server.php with a Bearer token. It is tried first as an OAuth 2.1 access token. If that does not match, and only if the administrator has turned the option on (it ships off), a permanent Moodle web service token is accepted, with its expiry and IP restriction. In both cases Moodle then runs the request as that user. Without the local/mcpserver:use capability, the call is rejected.
On top of that there are scopes: read, write and admin. Write ships turned off. A scope is not enough. Each tool checks again, in the course or activity it touches, the same Moodle capability the interface would use.
In the quiz that is easy to see. The tool loads the module by its cmid, checks that the user can see that activity, requires require_login on the course and, to change questions, mod/quiz:manage in that module’s context. Not at site level, not in “some course where they are a teacher”. In that quiz.
If that check is done in the wrong context, or not done at all, a teacher who does manage one quiz could end up changing another. That is exactly the kind of failure the advisories describe.
The door you have to watch
An MCP server does not add a back door. It adds another path to the same Moodle doors: capabilities and context.
The 20 November advisories are not about MCP. They are about web services that changed overrides and random question settings without making sure the teacher could manage that quiz. The lesson is the same whether you write your own tools or you forward calls to a core web service: the identifier in the request is not a permission. The permission is checked in the context of that activity, every time.
The urgent step, if you have not taken it yet, is to upgrade to a fixed version: 5.3.1, 5.2.5, 5.1.9 or 4.5.16, depending on the branch. If you are on 5.3 or 5.2, MSA-26-0062 does not apply to you; MSA-26-0061 does, and it is fixed in 5.3.1 and 5.2.5.
What I am leaving for the plugin is to review that no tool trusts an id without going through that check. That is where an IDOR slips in, whatever protocol sits in front of it.