The vulnerability stems from improper input validation in portfolio handling code. Moodle's portfolio system allowed user-controlled 'portfolio' parameters to directly determine which class to instantiate. The functions in portfolio/export.php that handle these requests would:
- Accept user-supplied class names via URL parameters
- Instantiate them without verifying if they're valid portfolio classes
- Enable attackers to instantiate arbitrary classes (including non-portfolio classes)
This matches the CWE-20 pattern and explains both the DDoS potential (through resource-intensive class instantiation) and the arbitrary class execution risk. The file paths and function names are consistent with Moodle's portfolio architecture and vulnerability description, though exact implementation details are inferred from security advisory patterns.