Trusted-RFC Impersonation and Callback Abuse
Two related RFC trust mechanisms let a caller skip normal authentication or borrow another user’s session - both are legitimate SAP features, and both are common misconfiguration targets distinct from the message-server-based 10KBLAZE attack chain (see RFC Gateway / 10KBLAZE):
- Trusted RFC (configured in
SM59/SMT1/SMT2) lets a “trusted” system call a “trusting” system without a password - the trusting side authenticates the connection itself, then authorizes the specific dialog user the trusted side asserts, via authorization objectS_RFCACL.S_RFCACLhas fieldsRFC_SYSID,RFC_CLIENT,RFC_USER,RFC_EQUSER,RFC_TCODE, andACTVT(only16/execute is valid). The critical field pair isRFC_EQUSER/RFC_USER: ifRFC_EQUSER = N(or*) andRFC_USER = *, the trusting system will execute the call as any user the trusted-side caller names - a caller who is onlyMEIERon the trusted system can assertSCHMIDT(or aSAP_ALLadmin ID) on the trusting system with zero further checks. - RFC callback lets a function module running on the server side of a synchronous RFC call use the already-open connection to call back into the client, executing a function module there under the identity of the user who initiated the original call. If the client trusts the server (e.g. the server is attacker-controlled or attacker-modified), the callback lets the server-side code run arbitrary RFC-enabled function modules with the client-side caller’s authorizations - including highly privileged administrative sessions.
Enumerate the whole RFC-trust landscape from either side with transaction RSRFCCHK, which lists every configured destination, flags which ones carry a stored password, and shows encryption status in one view (clearer than paging through SM59 connection by connection).
A misconfigured S_RFCACL (RFC_EQUSER=N/* + RFC_USER=*) turns any authenticated foothold on a trusted system into full impersonation of any user - commonly an admin ID - on every system that trusts it, with no password required and no additional exploit. Because trusted-RFC relationships frequently connect systems of different sensitivity (a lightly-secured development or Solution Manager system trusted by production), this is a textbook pivoting primitive. RFC callback abuse similarly lets a compromised or attacker-operated RFC server reach back into every client that calls it, executing code under the calling user’s privileges - a serious risk whenever the client cannot fully control or trust the server side of the connection. Both attacks require no vulnerability, only the (common) absence of the specific hardening described below.
- Recon - enumerate all configured destinations and their trust/credential posture with
RSRFCCHK; inSM59, check the Logon & Security tab of each ABAP connection for Trusted System = Yes, and cross-checkSMT1(trusted-system definitions) /SMT2(trusting-system view) for which systems trust which. - Trusted-RFC impersonation - from an authenticated session on the trusted system, call any RFC-enabled function module against the trusting destination while asserting a target user (e.g. via a custom RFC client using
pyrfc/pysap, orSE37test-call using a trusted connection). If the trusting system’sS_RFCACLgrantsRFC_EQUSER=N/*withRFC_USER=*to the calling system/client, the call executes as the asserted user with no password - check forSAP_ALL/admin IDs as easy high-value targets to assert. - RFC callback abuse - stand up an RFC server (SDK/
pyrfc) that, when called by a victim client, issues a synchronous callback (CALL FUNCTION <func> DESTINATION 'BACK') to execute an attacker-chosen RFC-enabled function module on the calling client, inheriting the calling user’s session andS_RFCauthorizations. Works wheneverrfc/callback_security_methodis at its pre-hardening default (1, compatibility mode - permits all callbacks not explicitly blocked) rather than3(allowlist enforced). - Passwordless trusted-destination creation - a trusted RFC destination can be created without
SM59orS_RFC_ADM:RFC_MODIFY_R3_DESTINATION(reachable viaRS_TESTFRAME_CALL, noSE37required) with a blankAUTHORITY_CHECK,TRUSTED_SYSTEM = X, and a blank password builds a password-less trusted connection to any system that already trusts the current one (enumerate candidates viaSMT1/RFCTRUST). This turns a foothold on a trusted system into an on-demand trusted pivot without touching the destination-maintenance authorizations that are normally watched. - Trusted-ticket replay (shared key) - on unpatched kernels, the trusted-system identification key (
extkey) is identical across all of a system’s trust relationships and is stored inRFCSYSACL, and the trusted ticket is sent on every outbound conversation regardless of trust; a captured ticket/key can be replayed against other systems that trust the same source (CVE-2023-0014, capture-replay; the related CVE-2021-27610 forges the internal-communication ticket for an internal-state auth bypass). Both stem from the server being unable to distinguish internal/trusted from external/untrusted partners when initiating a connection. Check kernel patch level for these before assuming trusted RFC is sound. - Anonymous recon primitives - a handful of RFC-enabled function modules answer without any authorization check and are useful for landscape mapping before attempting the above:
RFC_PING,RFC_SYSTEM_INFO,RFC_GET_DOCU,RFC_TRUSTED_SYSTEM_SECURITY,RFC_SET_REG_SERVER_PROPERTY,RFC_START_GUI,SYSTEM_CREATE_INSTANCE,RFC_START_PROGRAM. - Combine with Critical RFC-enabled function modules once impersonation succeeds - the newly-asserted identity’s
S_RFCscope determines what’s reachable next.
- Treat
S_RFCACLas critical: never grantRFC_USER = *together withRFC_EQUSER = N/*; where possible leaveRFC_USERblank so the trusted connection can only be used by the specific system RFC user it was created for. - Only establish Trusted RFC between systems of the same or higher security classification as the trusting side; never trust a development/QA/Solution Manager system from a production system.
- Set
rfc/selftrust = 0- self-trust is enabled by default (1), letting a system trust itself across clients without explicitSMT1setup; create explicit trust only where required. - Patch the trusted-ticket capture-replay family (SAP Notes 3007182 for CVE-2021-27610 and 3089413 for CVE-2023-0014, applied on both trusting and trusted systems), migrate the trust relationships per SAP Note 3157268, and set
rfc/allowoldticket4tt = noonce the whole landscape is migrated so legacy (insecure) trusted tickets are no longer accepted on either side.= clientis the interim value while only a single system has been migrated. - Protect
RFCSYSACLwith authorization groupTTRL(SAP Note 1562697) so the stored trust/key data is not broadly table-readable. - Prefer conventional (password-authenticated) RFC connections over Trusted RFC wherever the operational requirement doesn’t specifically demand password-less trust.
- Configure RFC callback allowlists: enable Security Audit Log class RFC function call for message ID
DUK(SM19), setrfc/callback_security_method = 2(simulation/logging mode) for a representative period (at least three months, to capture periodic jobs), populate the per-destination positive lists inSM59from the logged callbacks (manually or via the automatic-population menu action), then raiserfc/callback_security_methodto3(allowlist enforced) per SAP Note 1686632. - Restrict
S_RFC_ADM(RFC destination maintenance viaSM59) to Basis administrators; assign ownership/documentation responsibility to every RFC destination and remove unused ones. - Ensure
auth/rfc_authority_checkis set to enforceS_RFCchecking on every system (value0or negative disables the check entirely - a critical misconfiguration).
- Security Audit Log (
SM20/RSAU_READ_LOG): message IDDUK(callback rejected/would-be-rejected in simulation mode) andDUJ/DUIonce allowlist enforcement (rfc/callback_security_method=3) is active - anyDUJ(rejected) entry outside a known change is a strong signal of attempted callback abuse. - Trusted-RFC logons - correlate the calling system ID/client (
RFC_SYSID/RFC_CLIENT) against the expected trusted-system inventory fromSMT2; any trusted logon from an unexpected source, or asserting a user other than the RFC system user itself, warrants investigation. RSRFCCHKoutput drift - periodically snapshot and diff the destination/trust inventory; new Trusted System destinations or newly-stored passwords are configuration-change events.- Anonymous RFC calls (
RFC_SYSTEM_INFO,RFC_TRUSTED_SYSTEM_SECURITY, etc.) from unexpected source IPs in gateway/RFC traces (STRFCTRACE) - a common precursor to a trust-abuse attempt.
- SAP Note 1686632 - Positive lists for RFC callback
- SAP Note 1682316 - Consulting: Optimizing RFC User Authorizations
- SAP Note 3007182 - Improper Authentication (CVE-2021-27610), RFC trusted/internal communication
- SAP Note 3089413 - Capture-replay in trusted-RFC communication (CVE-2023-0014)
- SAP Note 3157268 - How-To: Migration of Trusted/Trusting Relationships (rfc/allowoldticket4tt)
- SAP Note 1562697 - Protecting table RFCSYSACL (authorization group TTRL)
- Book: SAP-Systeme schützen (Rheinwerk/SAP PRESS), Chapter 9 “Schutz von Remote Function Calls”, §9.1 “Technische Komponenten der RFC-Verbindungen” (Trusted RFC,
S_RFCACLfields,RFC_USER/RFC_EQUSER,RSRFCCHK, pp.210–214), §9.5 “RFC-Callback-Sicherheit aktivieren” (pp.226–228); Chapter 5 §5.6 “Klassische Angriffsvektoren für Hacker und Penetrationstester” (anonymous RFC function modules, p.142) - Book: SAP® System Security (SAP PRESS, 2026), §3.9.2 “RFC Authorizations” -
S_RFC/S_RFCACLfield reference, RFC hopping definition - Critical RFC-enabled function modules
- RFC Gateway / 10KBLAZE
- SM59 destination SSRF
- Lateral movement
