CVE-2021-38163 — SAP NetWeaver Unrestricted File Upload Vulnerability

CVE-2021-38163

SAP NetWeaver — Authenticated Low-Privilege File Upload Without Path Restrictions Enabling Webshell Deployment and Code Execution

What is SAP NetWeaver?

SAP NetWeaver is the foundational technology platform for SAP enterprise applications, including SAP ERP, SAP S/4HANA, SAP BW, and many other SAP systems. It provides the application server, development environment, and middleware layer for the SAP ecosystem. SAP NetWeaver systems contain an organization's most sensitive business data — financial records, HR data, supply chain information, customer databases — making them extremely high-value targets. SAP NetWeaver vulnerabilities are consistently exploited by sophisticated threat actors targeting enterprise business data.

Overview

CVE-2021-38163 is a critical unrestricted file upload vulnerability (CWE-22) in SAP NetWeaver. An authenticated user with only low-level privileges can upload files to arbitrary locations on the NetWeaver application server filesystem without restriction. By uploading a webshell (e.g., a JSP or ABAP script) to a web-accessible directory, an authenticated low-privilege user can achieve code execution on the server with the privileges of the NetWeaver application process. SAP patched this in September 2021; CISA added it to KEV in June 2022.

Affected Versions

Product Vulnerable Fixed
SAP NetWeaver (affected components) Versions before September 2021 patch SAP Security Note 3059926

Technical Details

The vulnerability exists in a SAP NetWeaver component that handles file operations. The file upload functionality does not adequately restrict the destination path, allowing an authenticated low-privilege user to write files to locations outside the intended scope:

  • Authentication required: Low — any valid SAP NetWeaver user account, including low-privilege accounts
  • Path restriction: None — the attacker can specify paths that resolve outside the intended upload directory
  • Webshell deployment: Uploading a JSP script to a Tomcat-accessible directory (NetWeaver uses Java-based application server components) provides arbitrary code execution via HTTP
  • Execution context: Code executes as the SAP NetWeaver application server service account — typically a highly privileged account with access to SAP databases and file systems
  • CVSS 9.9: The "Scope Changed" metric reflects that code execution on the NetWeaver application server provides access to the entire SAP system and connected business data

Discovery

Identified through SAP's internal security review and disclosed via the September 2021 SAP Patch Day.

Exploitation Context

SAP systems are high-priority targets for both nation-state actors (seeking business intelligence) and financially motivated criminals (data theft and ransomware). Threat actors with access to even a low-privilege SAP user account — obtainable through phishing, credential stuffing, or purchase on criminal markets — could exploit this to escalate to full NetWeaver server compromise. The CISA KEV addition in June 2022 reflects confirmed exploitation against unpatched SAP NetWeaver installations.

Remediation

  1. Apply SAP Security Note 3059926 via SAP Maintenance Planner or SPAM (SAP Patch Manager)
  2. Review SAP system for unauthorized files in web-accessible directories
  3. Restrict file upload functionality to authorized users with genuine business need
  4. Monitor SAP system logs for unusual file operations or requests to uploaded files
  5. Apply SAP's recommended security hardening guidelines (SAP Security Baseline) to limit the impact of any future file upload abuse
  6. Regularly audit SAP user accounts and access rights — low-privilege accounts should have only the minimum required authorizations

Key Details

PropertyValue
CVE ID CVE-2021-38163
Vendor / Product SAP — NetWeaver
NVD Published2021-09-14
NVD Last Modified2026-02-25
CVSS 3.1 Score9.9
CVSS 3.1 VectorCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
SeverityCRITICAL
CWE CWE-22 find similar ↗
CISA KEV Added2022-06-09
CISA KEV Deadline2022-06-30
Known Ransomware Use No

CVSS 3.1 Breakdown

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

Required Action

CISA BOD 22-01 Deadline: 2022-06-30. Apply updates per vendor instructions.

Timeline

DateEvent
2021-09-14SAP September 2021 Patch Day includes SAP Security Note 3059926
2021-09-14CVE published
2022-06-09Added to CISA Known Exploited Vulnerabilities catalog
2022-06-30CISA BOD 22-01 remediation deadline

References

ResourceType
SAP Security Note 3059926 — CVE-2021-38163 Fix Vendor Advisory
NVD — CVE-2021-38163 Vulnerability Database
CISA KEV Catalog Entry US Government