CVE-2020-17354
📋 TL;DR
CVE-2020-17354 is a security bypass vulnerability in LilyPond music engraving software that allows attackers to execute arbitrary code despite the -dsafe protection mechanism. Users who process untrusted .ly files with LilyPond versions before 2.24 are affected, particularly when converting files to different formats.
💻 Affected Systems
- LilyPond
📦 What is this software?
Lilypond by Lilypond
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise through arbitrary code execution with the privileges of the LilyPond process, potentially leading to data theft, ransomware deployment, or lateral movement.
Likely Case
Local privilege escalation or malware execution when processing malicious .ly files from untrusted sources.
If Mitigated
Limited impact if only trusted .ly files are processed or if LilyPond runs in a sandboxed environment.
🎯 Exploit Status
Exploitation requires the victim to process a malicious .ly file. The vulnerability bypasses the -dsafe protection via output-def-lookup or output-def-scope functions.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.24.0 and later
Vendor Advisory: https://lilypond.org/doc/v2.18/Documentation/usage/command_002dline-usage
Restart Required: No
Instructions:
1. Download LilyPond 2.24.0 or later from https://lilypond.org/download.html
2. Uninstall the vulnerable version
3. Install the patched version
4. Verify the installation with 'lilypond --version'
🔧 Temporary Workarounds
Process files in isolated environment
allRun LilyPond in a sandboxed container or virtual machine when processing untrusted .ly files
docker run --rm -v $(pwd):/data lilypond lilypond input.ly
Avoid processing untrusted files
allOnly process .ly files from trusted sources and validate file contents before processing
🧯 If You Can't Patch
- Implement strict file validation and only process .ly files from trusted, verified sources
- Run LilyPond with minimal privileges and in isolated environments (containers, VMs, or restricted user accounts)
🔍 How to Verify
Check if Vulnerable:
Run 'lilypond --version' and check if version is below 2.24.0
Check Version:
lilypond --version
Verify Fix Applied:
Run 'lilypond --version' and confirm version is 2.24.0 or higher
📡 Detection & Monitoring
Log Indicators:
- Unusual process execution from LilyPond
- Failed attempts to access restricted system resources
- Unexpected network connections from LilyPond process
Network Indicators:
- Outbound connections from LilyPond to unexpected destinations
- DNS queries for command and control domains
SIEM Query:
process_name:"lilypond" AND (process_cmdline:*output-def-lookup* OR process_cmdline:*output-def-scope*)
🔗 References
- http://lilypond.org/doc/v2.18/Documentation/usage/command_002dline-usage
- https://gitlab.com/lilypond/lilypond/-/merge_requests/1522
- https://lilypond.org/download.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/K43PF6VGFJNNGAPY57BW3VMEFFOSMRLF/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ST5BLLQ4GDME3SN7UE5OMNE5GZE66X4Y/
- https://phabricator.wikimedia.org/T259210
- https://tracker.debian.org/news/1249694/accepted-lilypond-2221-1-source-into-unstable/
- https://www.mediawiki.org/wiki/Extension:Score/2021_security_advisory
- http://lilypond.org/doc/v2.18/Documentation/usage/command_002dline-usage
- https://gitlab.com/lilypond/lilypond/-/merge_requests/1522
- https://lilypond.org/download.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/K43PF6VGFJNNGAPY57BW3VMEFFOSMRLF/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ST5BLLQ4GDME3SN7UE5OMNE5GZE66X4Y/
- https://phabricator.wikimedia.org/T259210
- https://tracker.debian.org/news/1249694/accepted-lilypond-2221-1-source-into-unstable/
- https://www.mediawiki.org/wiki/Extension:Score/2021_security_advisory