CVE-2024-45313

5.4 MEDIUM

📋 TL;DR

This vulnerability in Overleaf Server Pro allows users to access the sharelatex container's filesystem, network, and environment variables during LaTeX compiles when security features are disabled. It affects installations using the Overleaf Toolkit before 2024-07-17 or legacy docker-compose.yml before 2024-08-28 with insecure default configurations. Administrators who haven't manually enabled sandboxing are vulnerable.

💻 Affected Systems

Products:
  • Overleaf Server Pro
Versions: Installations using Overleaf Toolkit before 2024-07-17 or legacy docker-compose.yml before 2024-08-28
Operating Systems: Linux (containerized deployments)
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects installations where SIBLING_CONTAINERS_ENABLED=false (Toolkit) or SANDBOXED_COMPILES=false (legacy docker-compose). New installs now have secure defaults.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could read sensitive files, modify system configurations, access environment variables containing secrets, or potentially execute arbitrary code on the host container.

🟠

Likely Case

Unauthorized users accessing or exfiltrating sensitive project files, configuration data, or environment variables from the sharelatex container.

🟢

If Mitigated

With sandboxing enabled, compiles run in isolated sibling containers with no access to host resources, preventing all file access vulnerabilities.

🌐 Internet-Facing: MEDIUM - Overleaf instances exposed to the internet are vulnerable if misconfigured, but exploitation requires user access to trigger compiles.
🏢 Internal Only: MEDIUM - Internal users with access to the Overleaf instance could exploit this to access sensitive container resources.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW - Requires user access to trigger LaTeX compiles but no special privileges.

Exploitation requires access to the Overleaf instance and ability to trigger compiles. The vulnerability is in the container configuration, not the application code.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Toolkit updated 2024-07-17, docker-compose updated 2024-08-28

Vendor Advisory: https://github.com/overleaf/overleaf/security/advisories/GHSA-m95q-g8qg-wgj4

Restart Required: Yes

Instructions:

1. Update Overleaf Toolkit to version after 2024-07-17 or docker-compose.yml to version after 2024-08-28. 2. For existing installations, set SIBLING_CONTAINERS_ENABLED=true in config/overleaf.rc (Toolkit) or SANDBOXED_COMPILES=true (legacy docker-compose). 3. Restart the Overleaf services.

🔧 Temporary Workarounds

Enable sibling containers in Toolkit

linux

Manually enable secure sibling containers for LaTeX compiles

echo 'SIBLING_CONTAINERS_ENABLED=true' >> config/overleaf.rc
bin/stop
bin/start

Enable sandboxed compiles in legacy docker-compose

linux

Set environment variable to enable sandboxing

export SANDBOXED_COMPILES=true
docker-compose up -d

🧯 If You Can't Patch

  • Restrict user access to only trusted individuals who need LaTeX compilation capabilities
  • Monitor container logs for unusual file access patterns or symlink creation during compiles

🔍 How to Verify

Check if Vulnerable:

Check config/overleaf.rc for SIBLING_CONTAINERS_ENABLED=false (Toolkit) or docker-compose.yml for SANDBOXED_COMPILES=false/absent (legacy).

Check Version:

For Toolkit: check toolkit version date. For docker-compose: check file modification date or git commit history.

Verify Fix Applied:

Verify SIBLING_CONTAINERS_ENABLED=true appears in config/overleaf.rc or SANDBOXED_COMPILES=true in environment/docker-compose.yml, then test that compiles complete successfully.

📡 Detection & Monitoring

Log Indicators:

  • Unusual file access patterns from LaTeX compile processes
  • Symlink creation in unexpected directories during compiles
  • Compile processes accessing files outside project directories

Network Indicators:

  • Compile containers making unexpected network connections to internal services

SIEM Query:

container_logs WHERE process_name LIKE '%latex%' AND (file_access NOT LIKE '%/project/%' OR command LIKE '%ln -s%')

🔗 References

📤 Share & Export