Skip links
Picture of Vahagn Vardanian

Vahagn Vardanian

Co-founder and CTO of RedRays

CVE-2025-42910 – Critical Unrestricted File Upload Vulnerability in SAP SRM

Deep Analysis of a High-Severity Flaw in SAP Supplier Relationship Management

CVSS 9.0 HotNews Priority Published: October 14, 2025 Component: SRMNXP01

🚨 Critical Security Alert

SAP has disclosed a critical unrestricted file upload vulnerability affecting SAP Supplier Relationship Management (SRM) systems. This vulnerability allows authenticated attackers to upload and potentially execute malicious files, leading to complete system compromise. Immediate patching is required for all affected systems.

Vulnerability Overview

CVE-2025-42910 represents a severe security flaw in SAP Supplier Relationship Management that stems from insufficient validation of uploaded file types and content. The vulnerability exists in the attachment handling mechanism within the /SRMNXP/CL_ATTACHMENTS class, specifically affecting the HANDLE_POST method and related attachment processing functions.

This security gap allows authenticated users with low privileges to bypass file type restrictions and upload arbitrary files to the SAP SRM system. The absence of proper MIME type verification and file extension validation creates a dangerous attack vector that can be exploited to upload executable files containing malware, web shells, or other malicious payloads.

Technical Details

CVE Identifier
CVE-2025-42910
SAP Security Note
3647332
Affected Component
SRMNXP01 (Versions 100-150)
Vulnerability Type
CWE-434: Unrestricted Upload of File with Dangerous Type
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

Impact Assessment

🔓
Confidentiality
HIGH
⚠️
Integrity
HIGH
💥
Availability
HIGH
📡
Attack Vector
NETWORK

Potential Business Impact

  • Data Breach: Attackers can exfiltrate sensitive procurement data, supplier information, contract details, and financial records
  • Malware Distribution: Uploaded malicious files can be downloaded and executed by unsuspecting users, spreading malware throughout the organization
  • System Compromise: Successful exploitation can lead to complete control of the SAP SRM system, affecting critical business operations
  • Supply Chain Risk: Compromise of supplier relationship management systems can cascade to affect partner organizations and supply chain integrity
  • Regulatory Compliance: Security breaches may result in violations of GDPR, SOX, and other compliance requirements
  • Reputation Damage: Security incidents in procurement systems can severely impact organizational trust and vendor relationships

Attack Methodology

How the Attack Works

  1. Authentication: Attacker authenticates with low-privilege credentials to the SAP SRM system
  2. Access Upload Functionality: Navigates to attachment upload features within procurement workflows, shopping carts, or supplier documents
  3. Prepare Malicious Payload: Creates a malicious file disguised with legitimate extension or embedded within a document (e.g., macro-enabled Office files, executables renamed with double extensions)
  4. Bypass Validation: Exploits the absence of proper MIME type and content validation to upload the malicious file
  5. Social Engineering: Uses SRM's communication features to distribute the malicious file to other users, encouraging them to download and open it
  6. Payload Execution: When victims download and execute the file, malware is deployed, establishing persistence and enabling further exploitation
  7. Lateral Movement: Uses compromised credentials and system access to move laterally across the SAP landscape and connected systems

Why This Vulnerability is Critical

  • Low Barrier to Entry: Requires only low-privilege authenticated access, which is commonly available to procurement users
  • Network Accessible: Can be exploited remotely over the network without physical access
  • User Interaction Likely: Procurement processes naturally involve document sharing and review, making social engineering effective
  • Scope Change: Successful exploitation can affect resources beyond the original vulnerable component
  • Complete CIA Triad Impact: Affects confidentiality, integrity, and availability at the highest levels

Technical Root Cause Analysis

The vulnerability originates from inadequate input validation in the SAP SRM attachment handling mechanism. Prior to the security patch, the system failed to implement comprehensive checks on uploaded files, specifically:

Missing Security Controls

  • No MIME Type Validation: The system did not verify that uploaded files matched declared MIME types, allowing attackers to upload executables disguised as documents
  • Absent File Extension Checks: File extensions were not validated against a whitelist of allowed types, permitting dangerous file types like .exe, .bat, .ps1, .jsp
  • Lack of Content Inspection: Files were not inspected for malicious content or embedded executables within seemingly legitimate file formats
  • Insufficient Security Headers: HTTP responses lacked protective headers like Content-Type, X-Content-Type-Options, and Content-Security-Policy
  • No Content-Disposition Control: Uploaded files were not forced to download as attachments, allowing potential in-browser execution

The affected code modules include the /SRMNXP/CL_ATTACHMENTS class's HANDLE_POST method and the /SRMNXP/CL_TEMPORARY_CART class's GET_FTXT_ATTACHMENTS method. These components handle file upload processing and temporary storage of attachments in shopping carts and free-text items.

Affected Software Components

Component Details

Software Component
SRMNXP01 (SAP Supplier Relationship Management NetWeaver Portal)
Affected Versions
Release 100 through Release 150
Support Package Range
SAPK-10013INSRMNXP01 to SAPK-10032INSRMNXP01
Correction Instruction
0020751259

Modified ABAP Objects

  • Class: /SRMNXP/CL_ATTACHMENTS
    • Method: HANDLE_POST - Processes HTTP POST requests for file uploads
  • Class: /SRMNXP/CL_TEMPORARY_CART
    • Method: /SRMNXP/IF_FTXT_ATTACHMENT~GET_FTXT_ATTACHMENTS - Retrieves and serves uploaded attachments

Security Patch Implementation Analysis

SAP's security patch introduces comprehensive validation mechanisms to prevent unrestricted file uploads. The patch modifies the vulnerable methods to implement a defense-in-depth approach with multiple layers of validation.

Key Security Enhancements in the Patch

  1. MIME Type Whitelist Validation: The patch implements a strict whitelist of allowed MIME types including document formats (MS Office, PDF), image formats (JPEG, PNG, GIF, BMP), and text files (TXT, CSV)
  2. File Extension Whitelist: A comprehensive list of safe file extensions is enforced, blocking dangerous executable formats
  3. Dual Validation Requirement: Both MIME type AND file extension must pass validation - files must match approved lists for both attributes
  4. Security HTTP Headers: Response headers are modified to prevent content sniffing and script execution
  5. Forced Download Behavior: Content-Disposition headers force browser download rather than inline rendering

Allowed File Types After Patch

Document Formats:

  • Microsoft Office: DOC, DOCX, XLS, XLSX, XLSB, PPT, PPTX, PPSX, PPS
  • Microsoft Access: ACCDB, MDB
  • PDF Documents: PDF
  • Email Messages: MSG, EML

Image Formats:

  • Common image types: JPG, GIF, PNG, BMP

Text and Data Files:

  • Plain text and data: TXT, CSV

Technical Implementation: /SRMNXP/CL_ATTACHMENTS::HANDLE_POST Method

Key Changes:

1. Declaration of validation tables:

DATA : lt_allowed_mimes TYPE STANDARD TABLE OF w3conttype,
       lt_allowed_exts TYPE STANDARD TABLE OF sdok_fnext,
       lv_allowed TYPE abap_bool VALUE abap_false.

2. Security headers implementation:

lo_response->set_header_field(
  name = 'Content-Type' value = 'application/octet-stream' ).
lo_response->set_header_field(
  name = 'X-Content-Type-Options' value = 'nosniff' ).
lo_response->set_header_field(
  name = 'Content-Security-Policy'
  value = 'default-src ''none''; script-src ''none''; style-src ''none'';' ).

3. MIME type whitelist population:

APPEND 'application/pdf' TO lt_allowed_mimes.
APPEND 'application/vnd.ms-excel' TO lt_allowed_mimes.
APPEND 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
       TO lt_allowed_mimes.
APPEND 'image/jpeg' TO lt_allowed_mimes.
APPEND 'image/png' TO lt_allowed_mimes.
... (18 total approved MIME types)

4. File extension whitelist:

APPEND 'doc' TO lt_allowed_exts.
APPEND 'docx' TO lt_allowed_exts.
APPEND 'pdf' TO lt_allowed_exts.
APPEND 'jpg' TO lt_allowed_exts.
... (20 total approved extensions)

5. Dual validation logic:

READ TABLE lt_allowed_mimes WITH KEY table_line = lv_phio_mime
  TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
  READ TABLE lt_allowed_exts WITH KEY table_line = lv_phio_ext
    TRANSPORTING NO FIELDS.
  IF sy-subrc = 0.
    lv_allowed = abap_true.
  ENDIF.
ENDIF.

6. Rejection of invalid files:

IF lv_allowed = abap_false.
  MESSAGE e039(/SRMNXP/UI) WITH lv_phio_fname.
  RETURN.
ENDIF.

Technical Implementation: /SRMNXP/CL_TEMPORARY_CART Method

Key Changes in Attachment Retrieval:

1. Force safe content type:

server->response->set_content_type( 'application/octet-stream' ).

2. Original MIME type handling removed:

* COMMENTED OUT - Previously used original MIME type:
* CALL METHOD SERVER->RESPONSE->IF_HTTP_ENTITY~SET_CONTENT_TYPE
*   EXPORTING CONTENT_TYPE = lv_mime.

This change ensures that all downloaded files are treated as binary octet-streams, preventing browsers from automatically executing or rendering potentially malicious content.

Defense-in-Depth Strategy

The patch implements multiple security layers that work together:

  • Input Validation Layer: Dual whitelist checks on MIME type and file extension prevent malicious uploads
  • HTTP Security Headers: X-Content-Type-Options prevents MIME sniffing attacks
  • Content Security Policy: Blocks execution of scripts even if they bypass other controls
  • Content Type Forcing: Overrides declared MIME types with safe application/octet-stream
  • Download Behavior: Content-Disposition forces download instead of inline rendering

Explore More