CVE-2024-32406

7.5 HIGH

📋 TL;DR

This CVE describes a Server-Side Template Injection (SSTI) vulnerability in the Relate Learning and Teaching System that allows remote attackers to execute arbitrary code via the Batch-Issue Exam Tickets function. Attackers can achieve remote code execution on affected servers. Organizations running Relate versions before 2024.1 are affected.

💻 Affected Systems

Products:
  • Relate Learning and Teaching System
Versions: All versions before 2024.1
Operating Systems: Any OS running Relate
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in the Batch-Issue Exam Tickets function which is typically accessible to authenticated users with appropriate permissions.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise allowing attackers to execute arbitrary commands, steal sensitive data, install malware, pivot to other systems, and maintain persistent access.

🟠

Likely Case

Attackers gain shell access to the server, potentially accessing student data, exam materials, and administrative credentials, leading to data breach and system disruption.

🟢

If Mitigated

With proper network segmentation and least privilege, impact limited to the application server with no lateral movement to critical systems.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires authentication to access the vulnerable function, but once accessed, the SSTI payload execution is straightforward.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2024.1

Vendor Advisory: https://github.com/inducer/relate/releases/tag/2024.1

Restart Required: Yes

Instructions:

1. Backup your Relate installation and database. 2. Update to Relate version 2024.1 or later using pip: 'pip install --upgrade relate>=2024.1'. 3. Restart the Relate service. 4. Verify the update was successful.

🔧 Temporary Workarounds

Disable Batch-Issue Exam Tickets Function

all

Temporarily disable or restrict access to the vulnerable Batch-Issue Exam Tickets function until patching can be completed.

# Modify Relate configuration to remove/disable the vulnerable endpoint
# Implementation depends on your specific deployment configuration

Implement WAF Rules

all

Deploy Web Application Firewall rules to block SSTI payload patterns in requests to the vulnerable endpoint.

# Example ModSecurity rule: SecRule ARGS "\{\{.*\}\}" "id:1001,phase:2,deny,msg:'SSTI attempt detected'"
# Implementation varies by WAF platform

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate Relate servers from critical systems
  • Apply principle of least privilege to Relate service accounts and restrict shell access

🔍 How to Verify

Check if Vulnerable:

Check your Relate version. If it's older than 2024.1, you are vulnerable. Also review access logs for suspicious requests to the Batch-Issue Exam Tickets endpoint.

Check Version:

python -c "import relate; print(relate.__version__)" or check the Relate admin interface

Verify Fix Applied:

After updating, confirm the version is 2024.1 or newer and test that the Batch-Issue Exam Tickets function works without allowing template injection.

📡 Detection & Monitoring

Log Indicators:

  • Unusual template syntax in POST requests to exam ticket endpoints
  • Multiple failed authentication attempts followed by successful access to vulnerable function
  • Commands like 'os.system', 'subprocess', or 'eval' in request parameters

Network Indicators:

  • Unusual outbound connections from Relate server to external IPs
  • Large data exfiltration from the Relate server

SIEM Query:

source="relate-logs" AND (uri_path="/exam/tickets/batch" AND (request_body="{{*" OR request_body="${*" OR request_body="*|*"))

🔗 References

📤 Share & Export