Full Report
A container escape vulnerability, combined with accidental 'write' permissions to a private registry, opened a backdoor for Wiz Research to access Alibaba Cloud databases and potentially compromise its services through a supply-chain attack
Analysis Summary
# Vulnerability: #BrokenSesame - RCE and Cross-Tenant Access in Alibaba Cloud PostgreSQL Services
## CVE Details
* CVE ID: Not explicitly provided in the summary, referred to as **#BrokenSesame** research by Wiz.
* CVSS Score: Not explicitly provided, but described as **critical**.
* CWE: Likely related to Inadequate Isolation (CWE-264) and Improper Input Validation (CWE-20).
## Affected Systems
* Products: Alibaba Cloud ApsaraDB RDS for PostgreSQL, Alibaba Cloud AnalyticDB for PostgreSQL.
* Versions: Specific vulnerable versions are not listed, but the vulnerabilities existed in these managed services.
* Configurations: Multi-tenant environments utilizing Kubernetes orchestration where container isolation was inadequate and container registry permissions were over-scoped.
## Vulnerability Description
Wiz Research discovered a chain of vulnerabilities (#BrokenSesame) in Alibaba Cloud's PostgreSQL managed services, which allowed for **Remote Code Execution (RCE)** on the underlying database services by exploiting flaws in multitenancy isolation and container configuration.
The attack flow involved:
1. **Initial Compromise:** Executing code on the PostgreSQL container using previously discovered PostgreSQL flaws.
2. **Privilege Escalation/Container Escape (AnalyticDB):** Exploiting a cronjob vulnerability to gain root inside the container, followed by leveraging a command injection via an `ALTER ROLE` statement when executing a version upgrade check, targeting the `alicloud_rds_admin` username. This injection allowed code execution within the check container. This container was then used to overwrite the host's `/proc/sys/kernel/core_pattern` (since `/proc/sys` was writable) to execute a reverse shell on the K8s node upon process crash (container escape).
3. **Privilege Escalation/Container Escape (ApsaraDB RDS):** Similar container breakouts achieved RCE on the host node.
4. **Cross-Tenant Access:** Once on the K8s node, the attacker used Kubelet credentials to access and potentially compromise other tenants' databases co-located on the same node.
5. **Supply Chain Risk:** The compromised K8s node's credentials also had **write access** to the Alibaba Cloud private container registry, enabling a potential large-scale supply chain attack by overwriting base images.
## Exploitation
* Status: Successfully exploited in controlled research (PoC developed and executed).
* Complexity: Implied **High** due to chaining multiple complex techniques (privilege escalation, command injection, core_pattern container escape).
* Attack Vector: Adjacent (starting from a compromised container managed service) leading to Local/Network access to the underlying infrastructure.
## Impact
* Confidentiality: **High** (Potential unrestricted access to other tenants' PostgreSQL databases).
* Integrity: **High** (Ability to execute arbitrary code/commands on the host server and potentially overwrite service images).
* Availability: **High** (Service disruption possible through RCE/crash).
## Remediation
### Patches
* Alibaba Cloud confirmed that **all issues have been fully mitigated**. No specific patch versions are listed, as remediation was confirmed complete by the vendor.
### Workarounds
* Customers **did not require any action** as the issues were confirmed fully mitigated by Alibaba Cloud.
## Detection
* Indicators of Compromise (IoCs) would involve monitoring for unexpected write operations to sensitive kernel paths like `/proc/sys/kernel/core_pattern` from container processes, or unusual network connections originating from database containers to internal orchestration APIs (like Kubelet).
* Detection methods should focus on **cloud isolation monitoring**, checking for overly permissive credentials associated with infrastructure management components (especially container registry write access), and strict enforcement of container runtime security profiles (e.g., seccomp, AppArmor) to prevent kernel manipulation.
## References
* Wiz Research Advisory: Described as #BrokenSesame research. (Note: URLs must be defanged)
* Relevant Links:
* wiz dot io slash blog slash wiz-research-discovers-extrareplica-cross-account-database-vulnerability-in-azure-postgresql
* wiz dot io slash blog slash hells-keychain-supply-chain-attack-in-ibm-cloud-databases-for-postgresql