CVE-2021-37531
📋 TL;DR
CVE-2021-37531 is an XSLT injection vulnerability in SAP NetWeaver Knowledge Management XML Forms that allows authenticated non-administrative users to execute arbitrary OS commands via malicious XSL stylesheets. This can lead to complete system compromise affecting all SAP NetWeaver versions from 7.10 to 7.50. Attackers need authenticated access to exploit this vulnerability.
💻 Affected Systems
- SAP NetWeaver Knowledge Management XML Forms
📦 What is this software?
Netweaver Knowledge Management Xml Forms by Sap
View all CVEs affecting Netweaver Knowledge Management Xml Forms →
Netweaver Knowledge Management Xml Forms by Sap
View all CVEs affecting Netweaver Knowledge Management Xml Forms →
Netweaver Knowledge Management Xml Forms by Sap
View all CVEs affecting Netweaver Knowledge Management Xml Forms →
Netweaver Knowledge Management Xml Forms by Sap
View all CVEs affecting Netweaver Knowledge Management Xml Forms →
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise allowing attackers to execute arbitrary OS commands, steal sensitive data, install malware, pivot to other systems, and maintain persistent access.
Likely Case
Attackers with authenticated access gain remote code execution, potentially compromising the SAP server and accessing sensitive business data.
If Mitigated
With proper network segmentation, least privilege access, and monitoring, impact is limited to the affected SAP system with containment preventing lateral movement.
🎯 Exploit Status
Public exploit code exists and has been weaponized. Attack requires authenticated access but not admin privileges. XSLT injection leads directly to OS command execution.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Apply SAP Security Note 3081888
Vendor Advisory: https://launchpad.support.sap.com/#/notes/3081888
Restart Required: Yes
Instructions:
1. Download SAP Security Note 3081888 from SAP Support Portal. 2. Apply the note using SAP Note Assistant or transaction SNOTE. 3. Restart the affected SAP system components. 4. Verify the patch is applied correctly.
🔧 Temporary Workarounds
Restrict XSL file uploads
allImplement strict file upload controls to prevent unauthorized XSL file uploads to the system.
Network segmentation
allIsolate SAP systems from critical infrastructure and implement strict firewall rules.
🧯 If You Can't Patch
- Implement strict access controls to limit authenticated user access to minimum required privileges
- Deploy application-level firewalls (WAF) with XSLT injection detection rules
🔍 How to Verify
Check if Vulnerable:
Check if SAP Security Note 3081888 is applied using transaction SNOTE or by checking system patch status.
Check Version:
In SAP GUI, use transaction SM51 or check system information in SAP logon pad.
Verify Fix Applied:
Verify SAP Security Note 3081888 is successfully applied and system has been restarted. Test XSLT functionality with safe test files.
📡 Detection & Monitoring
Log Indicators:
- Unusual XSL file uploads
- Suspicious OS command execution from SAP processes
- Multiple failed authentication attempts followed by successful login
Network Indicators:
- Unusual outbound connections from SAP servers
- Traffic patterns indicating data exfiltration
SIEM Query:
source="sap_audit_log" AND (event="file_upload" AND file_extension="xsl") OR (process_execution AND parent_process="sap*" AND command_line="cmd*" OR "bash*")
🔗 References
- http://packetstormsecurity.com/files/165751/SAP-Enterprise-Portal-XSLT-Injection.html
- http://seclists.org/fulldisclosure/2022/Jan/75
- https://launchpad.support.sap.com/#/notes/3081888
- https://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=585106405
- http://packetstormsecurity.com/files/165751/SAP-Enterprise-Portal-XSLT-Injection.html
- http://seclists.org/fulldisclosure/2022/Jan/75
- https://launchpad.support.sap.com/#/notes/3081888
- https://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=585106405