Critical RFC-Enabled Function Modules
The RFC Gateway (33XX) exposes thousands of RFC-enabled function modules (FMs) and BAPIs to any caller holding a valid RFC logon. A handful of standard, SAP-shipped FMs are so broadly capable that authorization to call them is functionally equivalent to full system control - no vulnerability or exploit required, only a missing or over-broad S_RFC grant for the function group in question. This page catalogs the small set of FMs that repeatedly turn up as the payload of an RFC-based attack chain:
RFC_READ_TABLE- generic, parameter-driven read of any DB table via RFC, bypassing the transaction-level authority checks aSE16/SE16Nbrowse would normally enforce. Returns rows as delimiter-packed strings (mangles binaryRAWfields).SXPG_STEP_XPG_START/SXPG_COMMAND_EXECUTE(function groupSXPG) - runs an OS command defined inSM49/SM69as the SAP work-process OS user. See OS command execution for the full primitive.RFC_ABAP_INSTALL_AND_RUN(and its hardened-kernel rename/SAPDS/RFC_ABAP_INSTALL_RUN) - compiles and executes an ad-hoc ABAP report supplied entirely over RFC. Arbitrary ABAP is arbitrary code execution in the application-server context.BAPI_USER_CREATE1(+BAPI_USER_PROFILES_ASSIGN,BAPI_TRANSACTION_COMMIT) - remote user provisioning; chaining these three creates a new user and grants itSAP_ALLin one RFC round trip.
These FMs are reachable over binary RFC to the Gateway/dispatcher (33XX, or 48XX when SNC is enforced) and, identically, over the SOAP-RFC HTTP bridge - see SOAP-RFC over HTTP.
Any credential with unrestricted S_RFC for these function groups converts a single authenticated RFC logon into: arbitrary table disclosure (RFC_READ_TABLE), OS command execution as the SAP work-process user (SXPG_*, which itself bridges to a SAP* super-user session - see virtual SAP*), arbitrary ABAP execution (RFC_ABAP_INSTALL_AND_RUN), and a persistent SAP_ALL account (BAPI_USER_CREATE1). Together they cover confidentiality, integrity, and availability of the whole system and, via RFC destination pivoting, the wider landscape.
- Table read -
RFC_READ_TABLE(QUERY_TABLE=<table>, DELIMITER='|', ...); gated byS_TABU_DIS/S_TABU_NAM(andS_TABU_LINfor row-level restrictions) on top ofS_RFCfor the function group. Common target:RSECTAB,USR02- see secure store decryption. - OS command execution -
SXPG_STEP_XPG_START/SXPG_COMMAND_EXECUTEagainst a command pre-registered inSM49/SM69; gated byS_LOG_COM. Older kernels reject theMXROWparameter (RFC_INVALID_PARAMETER) - retry without it. - Arbitrary ABAP -
RFC_ABAP_INSTALL_AND_RUN(PROGRAM=<source lines>); compiles then executes.S_DEVELOPis the gate on modern kernels.PROGRAMtable rows are silently truncated past ~72 characters - long generated source must be chunked. - Privilege escalation via user creation - chain
BAPI_USER_CREATE1->BAPI_USER_PROFILES_ASSIGN(BAPIPROFILE=[{BAPIPROF:"SAP_ALL"}])->BAPI_TRANSACTION_COMMIT(WAIT='X'). Tolerate an “already exists” return (message class01/102) on create and still proceed to the profile assign - this still grantsSAP_ALLto a pre-existing account.BAPI_USER_PROFILES_ASSIGNreplaces the full profile list, dropping any pre-existing profiles. Gated byS_USER_GRP/S_USER_AUT/S_USER_PRO. - Tooling: SAPMAP
modules/discovery/sapmap_rfc.py(binary RFC viapyrfc/NW RFC SDK), SAPMAPmodules/protocols/sap_soap_basic.py(same FM set over HTTP - see SOAP-RFC over HTTP); manual equivalent:SE37test-call with an authorized user, or an RFC destination configured withpyrfc/pysap.
NoteNone of these FMs are defects - they are documented SAP interfaces. The entire attack surface is theS_RFCgrant (which function groups a given RFC user may call) plus the FM’s own object-level authorizations. AuditingS_RFCscope per RFC user/service account is the single highest-leverage control here.
- Restrict
S_RFCper RFC user/service account to the minimal function-group set actually required; never grantS_RFCwithACTVT=16andRFC_NAME=*. - Restrict
SXPG_STEP_XPG_START/SXPG_COMMAND_EXECUTEviaS_LOG_COMto trusted service accounts; keep theSM49/SM69external-command allowlist minimal. - Restrict
RFC_ABAP_INSTALL_AND_RUN//SAPDS/RFC_ABAP_INSTALL_RUNviaS_DEVELOPto genuine developer/service accounts. - Restrict
S_TABU_DIS/S_TABU_NAMsoRFC_READ_TABLEcannot reach sensitive tables (RSECTAB,USR02,RFCDES,RFCTRUST,RFCSYSACL). - Restrict
S_USER_GRP/S_USER_AUT/S_USER_PROsoBAPI_USER_CREATE1/BAPI_USER_PROFILES_ASSIGNcannot be used to self-grantSAP_ALL; monitor any assignment ofSAP_ALLvia these BAPIs. - Never assign
S_RFCACL/S_RFCinsideSAP_ALL; keep landscape-wide RFC trust (RFCTRUST/RFCSYSACL) scoped and reviewed - a compromised low-privilege credential otherwise maps the whole RFC-trust landscape viaRSRFCCHK/RFCDESreads.
- Security Audit Log (
SM20/RSAU_READ_LOG): enable audit classes covering RFC/CPIC logon and dangerous function-module calls, not just dialog logon. RFC_READ_TABLEreads ofRSECTAB,USR02,RFCDES,RFCTRUST,RFCSYSACL- no legitimate business read use case.SXPG_STEP_XPG_START/SXPG_COMMAND_EXECUTEcalls from unexpected source IPs/users; correlate withSM49/SM69external-command definitions.RFC_ABAP_INSTALL_AND_RUNcompiling/running short-lived, dynamically-installed report names from a non-developer source; correlate withST22short dumps.BAPI_USER_PROFILES_ASSIGNcalls that grantSAP_ALL- high-confidence indicator regardless of caller.GET_TABLEBLOCK_COMPRESSED_RFCand rawRFCDES-table reads bypassingRFC_GET_FUNCTION_INTERFACEmetadata lookups are rare in normal operations and a strong automated-tool signal in an RFC trace (STRFCTRACE/STAUTHTRACE).
- SAP Note 1682316 - Consulting: Optimizing RFC User Authorizations
- SAP Note 3007182 - CVE-2021-27610, Improper Authentication in SAP NetWeaver ABAP Server and ABAP Platform (“RFC Loopback”)
- SAP Note 3044754 - CVE-2021-33677, Information Disclosure in SAP NetWeaver AS ABAP and ABAP Platform
- SAP Note 3032624 - CVE-2021-33684, Memory Corruption in SAP NetWeaver AS ABAP and ABAP Platform
- SAP Note 3089413 - CVE-2023-0014, Capture-replay vulnerability in SAP NetWeaver AS for ABAP and ABAP Platform
- SAP-Systeme schützen (Rheinwerk/SAP PRESS) - RFC connections and Gateway chapter
- SAP® System Security (SAP PRESS, 2026) -
S_RFCACLauthorization object detail - pysap (OWASP CBAS)
