Skip to content
RCE Advisory Intermediate CVE-2021-21809

Moodle spellchecker plugin command execution vulnerability

The Moodle legacy spellchecker plugin constructs a shell command using an administrator-controlled path to the aspell binary without sanitisation. An attacker with administrator privileges could inject shell commands that execute when a spellcheck request is made, potentially leading to remote code execution.

Adam Reiser Follow

Originally disclosed on Cisco Talos

High 8.2 View original

A command execution vulnerability exists in the default legacy spellchecker plugin in Moodle 3.10. A specially crafted series of HTTP requests can lead to command execution.

Adam Reiser, on Cisco Talos

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker with administrator privileges could execute arbitrary commands on the server, though the report notes that Moodle's security model normally prevents code execution via the web interface.

What the attacker needed

Administrator privileges

The fix

The vulnerability was not explicitly stated as fixed in the text; the vendor updated documentation to suggest best practices after installation.

How it was found

  1. Set the aspellpath setting to a value containing a shell injection.
  2. Set the spell engine to PSpellShell.
  3. Invoke the spellchecker via checkWords or getSuggestions, which can be done unauthenticated.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Moodle lets an administrator set the location of a spell-checking program. The software then runs that program using a system command without checking the path for special characters. An attacker who is already an administrator can put extra commands in that path, and those commands run on the server when someone uses the spell checker.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Adam Reiser

View all

1 more disclosed report, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.