CVE-2021-26476

9.8 CRITICAL

📋 TL;DR

CVE-2021-26476 is a critical OS command injection vulnerability in EPrints 3.4.2 that allows remote attackers to execute arbitrary commands on the server via specially crafted LaTeX input. This affects all EPrints 3.4.2 installations with the vulnerable calendar component exposed. Attackers can gain complete control of affected systems without authentication.

💻 Affected Systems

Products:
  • EPrints
Versions: 3.4.2
Operating Systems: All platforms running EPrints
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the calendar component (cgi/cal) that processes LaTeX input. All default installations of EPrints 3.4.2 are vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise allowing attackers to execute arbitrary commands as the web server user, potentially leading to data theft, ransomware deployment, or complete server takeover.

🟠

Likely Case

Remote code execution leading to web shell installation, data exfiltration, or lateral movement within the network.

🟢

If Mitigated

Limited impact with proper input validation and command sanitization in place, though the vulnerability still presents significant risk.

🌐 Internet-Facing: HIGH - The vulnerability is exploitable via web requests without authentication, making internet-facing instances extremely vulnerable.
🏢 Internal Only: HIGH - Even internal instances are vulnerable to authenticated or unauthenticated attackers with network access.

🎯 Exploit Status

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

The exploit requires crafting malicious LaTeX input to the vulnerable calendar endpoint. Public proof-of-concept code exists and the attack vector is straightforward.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.4.3 and later

Vendor Advisory: https://files.eprints.org/2548/

Restart Required: No

Instructions:

1. Upgrade EPrints to version 3.4.3 or later. 2. Apply the security patch from the vendor advisory. 3. Verify the calendar component no longer accepts unsanitized LaTeX input.

🔧 Temporary Workarounds

Disable vulnerable calendar endpoint

all

Temporarily disable or restrict access to the cgi/cal endpoint

# In Apache: RewriteRule ^/cgi/cal - [F]
# In Nginx: location ~ ^/cgi/cal { deny all; }

Input validation filter

linux

Implement WAF rules to block malicious LaTeX patterns

# Example ModSecurity rule: SecRule ARGS "@rx \\[^a-zA-Z0-9]" "id:1001,phase:2,deny"

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all LaTeX input parameters
  • Deploy a web application firewall (WAF) with rules specifically targeting OS command injection patterns

🔍 How to Verify

Check if Vulnerable:

Test if the /cgi/cal endpoint accepts and processes LaTeX input containing shell metacharacters like ;, |, or $()

Check Version:

Check the EPrints version in the admin interface or review the software version files

Verify Fix Applied:

Verify that the calendar endpoint properly sanitizes LaTeX input and rejects commands containing shell metacharacters

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST/GET requests to /cgi/cal with LaTeX parameters
  • Commands containing shell metacharacters in web logs
  • Unexpected process execution from web server user

Network Indicators:

  • HTTP requests to calendar endpoint with encoded shell commands
  • Outbound connections from web server to unexpected destinations

SIEM Query:

source="web_logs" AND (uri="/cgi/cal" AND (param="*;*" OR param="*|*" OR param="*$(*"))

🔗 References

📤 Share & Export