Security & privacy

SAP Python SDK flaw exposes OAuth2 credentials via tenant subdomain

A critical vulnerability in SAP's Cloud SDK for Python allows attackers to steal OAuth2 client credentials by manipulating tenant subdomains. Versions 0.53.0 to 0.55.0 remain affected despite an earli

Glass cube with red warning symbols leaking onto a circuit board
Illustration generated for this article

SAP disclosed a critical security vulnerability in its Cloud SDK for Python on October 13, revealing that the library could leak OAuth2 client credentials to attacker-controlled servers. The flaw, tracked as CVE-2026-89111, affects multi-tenant applications running on the SAP Business Technology Platform (BTP) and carries a maximum CVSS score of 10.0.

What happened

The vulnerability stems from how the SDK handles tenant subdomains when requesting access tokens. If an application passes a maliciously crafted subdomain to the SDK, the library constructs a URL that directs the application’s client ID and client secret to an external server controlled by the attacker. SAP identified version 0.45.2, released on August 21, as the initial fix for this issue. However, independent testing by The Hacker News revealed that the protection was not consistently applied in subsequent releases.

Specifically, versions 0.53.0 through 0.55.0, published between September 10 and September 18, reintroduced the vulnerability for calls made to the Destination service module. This regression occurred because version 0.53.0 migrated the module to new shared code for token requests, which lacked the necessary validation checks. Additionally, two older releases in the 0.36 line, versions 0.36.1 and 0.36.2, also failed to include the fix despite being published after the initial patch. SAP’s advisory currently lists no versions above 0.45.2 as affected, leaving ambiguity about whether these later regressions fall under the same CVE.

How it works

The SDK authenticates services using the application’s client credentials, consisting of a client ID and a client secret. When an application requests an access token for a specific tenant, the SDK takes the token URL from the configuration and inserts the tenant subdomain into it. In vulnerable versions, the SDK did not validate the format of this subdomain. An attacker who could control the subdomain value could inject URL delimiters, redirecting the authentication request to their own server.

This mechanism is classified as a server-side request forgery (SSRF), where a server is tricked into sending data to an unintended destination. The fix implemented in version 0.45.2 and restored in 0.55.1 adds a strict validation check. It ensures that the tenant subdomain contains only letters, digits, and hyphens, with a maximum length of 63 characters. Any value containing special characters or URL syntax now raises a ValueError immediately, preventing the credentials from being transmitted to an external endpoint.

Key details

  • Vulnerability ID: CVE-2026-89111 with a CVSS score of 10.0.
  • Affected versions: All versions below 0.45.2, versions 0.53.0 to 0.55.0 for Destination service calls, and versions 0.36.1 and 0.36.2.
  • Fixed versions: 0.45.2 through 0.52.2 and 0.55.1 through 0.58.4.
  • Attack vector: Requires the attacker to control the tenant subdomain passed to the SDK.
  • Impact: Theft of OAuth2 client ID and client secret, potentially allowing unauthorized access to BTP services.
  • Disclosure timeline: Fix released in August 2026; public advisory issued on October 13, 2026.

Why it matters

For developers building multi-tenant applications on SAP BTP, this vulnerability represents a severe risk to identity management. The exposure of client secrets can compromise the entire application’s ability to securely interact with SAP services. Since the flaw involves SSRF, it bypasses traditional network perimeter defenses, making it difficult to detect without specific application-level monitoring. The fact that the fix was initially labeled as a bug fix rather than a security patch may have led some teams to delay upgrading, increasing their window of exposure.

The regression in versions 0.53.0 to 0.55.0 highlights the challenges of maintaining security across complex software supply chains. When code is refactored or moved to shared libraries, security controls can be inadvertently dropped. Teams relying on automated dependency updates might have pulled in these vulnerable versions thinking they were newer and therefore safer. This incident underscores the need for rigorous testing of security patches, especially when major structural changes are made to authentication modules.

What you can do

  • Check your current version of the SAP Cloud SDK for Python against the affected ranges listed in the advisory.
  • Upgrade to version 0.58.4 or later, which is the newest release on PyPI as of October 13.
  • If you are on the 0.36 line, note that upgrading within that branch does not fix the issue; you must migrate to a newer major version.
  • Implement a pre-check in your application code to validate tenant subdomains against a whitelist of registered tenants before passing them to the SDK.
  • Review logs for any unusual outbound authentication requests that may indicate prior exploitation.
  • Rotate your OAuth2 client credentials if you suspect your application may have been exposed to the vulnerability.
  • #sap
  • #python
  • #security
  • #oauth2
  • #vulnerability

Tools from the Bytechap store

Keep reading

All stories