On-Premise <-> SAP BTP Credential Based Pivot
Hybrid landscapes create a bidirectional trust boundary between on-prem ABAP systems and BTP subaccounts, and both directions are practically exploitable once one side is compromised:
- On-prem -> BTP: on-prem systems routinely hold live, usable cloud credentials - SM59 HTTP destinations,
OA2C_CONFIGOAuth2 client profiles, ABAPRSECTAB/Java SecStoreFS entries - trusted to reach*.hana.ondemand.com. Once decrypted or abused, these are exchanged directly at the tenant’s XSUAA/oauth/tokenendpoint for a live BTP access token, converting an on-prem foothold into cloud-subaccount access without a BTP administrator ever handing out credentials. - BTP -> on-prem: a BTP-side foothold (a CF app, a stolen client-credentials/x509 pair) can drive the SCC Principal Propagation trust chain to impersonate an on-prem ABAP user - see Principal Propagation Abuse for the full mechanism; this page covers only the BTP-side reachability precondition.
No CVE underlies either direction - both are legitimate SAP OAuth2/XSUAA, RFC-8705, and Principal Propagation mechanisms used exactly as designed. The finding is credential and trust hygiene across the hybrid boundary, not a software bug.
A compromised on-prem system is routinely also a working BTP credential store - the blast radius of an on-prem compromise extends into the customer’s cloud subaccount by default unless destinations/OAuth clients/SecStore entries pointing at BTP are treated as Tier-0 material. Conversely, CF-level BTP access (Space Developer or above) can reach into on-prem systems via SCC without ever knowing an on-prem password, provided Principal Propagation is misconfigured as described in the companion page.
Harvest (offline, from already-captured on-prem state - no live traffic):
- SM59 HTTP destinations with a decrypted SecStore password, whose target host ends in
.hana.ondemand.com- requires the destination’srfc_user(asclient_id) and password. - OA2C OAuth2 Client profiles (
OA2C_CLIENT/OA2C_CLIENT_EXT, joined byCLIENT_UUID) - the canonical/highest-fidelity source:client_id, token endpoint, and grant type all come from ABAP configuration rather than URL-pattern heuristics. The matchingclient_secretlives in the ABAP Secure Store as/OA2C/CS_<CLIENT_UUID_no_hyphens>_<NN>- decrypt per Secure Store Decryption. - ABAP
RSECTAB(with a regex fallback for embedded URLs) and Java SecStoreFS entries - opportunistic fallback sources. - Manual equivalent:
SE16/SE16NonRSECTAB, SM59 destination inspection,SU01/SOA_MANAGERreview ofOA2C_CLIENT.
Mint - three mechanisms, increasing stealth/sophistication:
- Plain
client_credentialsbasic-auth -POST <uaa_url>withAuthorization: Basic base64(client_id:client_secret),grant_type=client_credentials. No on-prem system involvement at request time; the on-prem system was only the source of the credential. Publicly-reachable HTTPS call against the customer’s own XSUAA tenant - fully reproducible, no special network position beyond outbound HTTPS.curl -u client_id:client_secret <uaa_url> -d grant_type=client_credentials - Kernel-proxied cert-auth (RFC 8705, no secret) - an mTLS
client_credentialsgrant issued through the on-prem ABAP system itself over an existing SM59 Type-G/H destination: the SAP kernel performs the mutual-TLS handshake using the destination’s STRUST PSE, so the private key never leaves the on-prem kernel and, from XSUAA’s perspective, the calling identity is the on-prem system’s own registered x509 client. Requires a live RFC session and an SM59 destination pointing at<sub>.authentication.cert.<region>.hana.ondemand.com. - Local-process cert-auth - the identical RFC 8705 flow issued directly from the operator’s own host with a PEM cert/key pair, bypassing the on-prem kernel entirely. Built to route around a documented kernel 7.53 HTTP/2->1.1 chunked-response body-loss bug against XSUAA. The realistic precondition for this specific path - a valid cert/key pair - is usually satisfied via
cf create-service-keyagainst anX509_GENERATEDXSUAA binding, itself a cloud-side, Space-Developer-class self-service action (see Service Key Abuse) rather than an on-prem-extracted artefact - despite living conceptually in the “on-prem->BTP” direction, this path’s realistic use case is often “already have BTP access, mint a cert-bound token to avoid the basic-auth secret path.”
- Reproducibility gate - the critical precondition to flag before attempting this direction: the live BTP-side leg only works from inside BTP’s own runtime for the target region - the connectivity proxy hostname is not internet-reachable by design. This is satisfiable from either application runtime in the customer’s own subaccount (not a SAP-managed-infrastructure dependency), provided the tester holds - or has pivoted to - a workload foothold there:
- Cloud Foundry - tunnel through a controlled app, or run probe tooling as a workload in the CF org/space:
cf ssh -L 20003:<proxy-host>:<proxy-port> <app-name> - Kyma - a workload that can reach the in-cluster Connectivity Proxy service inherits the same on-prem reach; the Application Connector’s on-prem credentials also sit as Secrets in
kyma-system. See Kyma Application Connector Pivot.
- Cloud Foundry - tunnel through a controlled app, or run probe tooling as a workload in the CF org/space:
- Chaining note: this precondition is frequently already satisfied by the on-prem->BTP harvest above - a stolen
client_credentials/x509 pair reaches BTP APIs, andcf create-service-key-derived access (or a KymaServiceBindingSecret) reaches the runtime directly - or simply by engagement scope explicitly granting the tester a CF space or Kyma namespace. - The full destination-resolve -> connectivity-proxy forward-request ->
/sap/bc/pingverdict -> whoami-detection mechanism is documented in Principal Propagation Abuse - not duplicated here.
- Treat every SM59 HTTP destination, OA2C client profile, and SecStore entry pointing at
*.hana.ondemand.comas Tier-0 material - rotate on any suspected on-prem compromise, same as any other privileged credential. - Prefer x509/PSE-bound destinations over static-secret OA2C bindings where feasible - a stolen PSE still requires the on-prem kernel (or a stolen private key file) to exercise, raising attacker cost versus a portable
client_secretstring. - Restrict which roles/personas can mint
X509_GENERATEDservice keys - Space Developer access should not translate into arbitrary self-issued, cert-bound BTP credentials. - Monitor XSUAA
client_credentialsgrant volume and unusual client_id/geography combinations; alert on any x509-bound token mint whose calling TLS fingerprint diverges from the expected on-prem system’s registered certificate. - Apply least-privilege scoping to every OAuth2 client registered against a subaccount - a harvested credential should grant the minimum destination/service access necessary.
- Restrict
destination_configuration.writescope and which CF apps/spaces can reach the BTP connectivity proxy segment - see Principal Propagation Abuse for the full mitigation set on the BTP->on-prem direction.
- On-prem ABAP:
RFC_ABAP_INSTALL_AND_RUNexecution and dynamic report compilation is a strong indicator on systems where ad-hoc report generation via RFC is not an expected admin workflow - audit via Security Audit Log (SM20/RSAU_READ_LOG). - On-prem ABAP: outbound
CL_HTTP_CLIENTcalls to*.hana.ondemand.comhosts originating from an SM59 destination not normally exercised at that frequency/time - ICM trace / STRUST usage logging on the source PSE. - BTP/XSUAA: monitor
client_credentialstoken-mint volume perclient_idfor anomalous spikes, especially against x509-bound clients whose certificate thumbprint doesn’t match the expected calling system’s known fingerprint. - BTP/XSUAA: repeated basic-auth
client_credentialsfailures (wrong/rotated secret) followed by success is a signature of an attacker iterating through multiple harvested candidate secrets. - Reverse-direction (BTP->on-prem) detection is covered in Principal Propagation Abuse - not duplicated here.
https://www.rfc-editor.org/rfc/rfc8705- RFC 8705, OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens- SAP Help Portal - Calling the Destination Service REST API
- Cloud Connector for SAP Cloud Platform: How-to Guide (SAP PRESS), §7.4 “Principal Propagation”
- Secure Store Decryption - companion page, on-prem SecStore/RSECTAB decrypt feeding the harvest step
- Service Key Abuse - companion page,
X509_GENERATEDservice-key minting - Principal Propagation Abuse - companion page, the BTP->on-prem direction in full
