Critical Vulnerabilities in Azure PostgreSQL Exposed User Databases
Cloud security company Wiz has released the details of a series of critical vulnerabilities that could have been exploited to access databases belonging to Azure customers.
The security holes discovered by Wiz researchers are collectively tracked as ExtraReplica — the name stems from the fact that the flaws affected a database replication feature. They impacted Azure Database for PostgreSQL Flexible Server, a fully managed PostgreSQL database-as-a-service offering.
“By exploiting an elevated permissions bug in the Flexible Server authentication process for a replication user, a malicious user could leverage an improperly anchored regular expression to bypass authentication to gain access to other customers’ databases,” Microsoft said in its own blog post published on Thursday.
Microsoft was informed about the vulnerabilities in January and implemented patches within 48 hours. Azure customers do not need to take any action and the tech giant said it had no evidence of malicious exploitation attempts. It’s unclear how many databases were exposed by the vulnerabilities.
Wiz said Microsoft awarded its researchers a $40,000 bug bounty — the amount can be viewed as confirmation of the vulnerability’s severity.
The researchers identified two vulnerabilities: a privilege escalation flaw and a cross-account authentication bypass leveraging a forged certificate. Since the security holes affect cloud services, no CVE identifiers have been assigned, but Wiz believes a cloud vulnerability database would be very useful to organizations.
In an ExtraReplica attack, the attacker first needed to identify the targeted PostgreSQL Flexible Server instance and retrieve its common name and unique identifier from certificate transparency services. The attacker then needed to acquire a specially crafted certificate with a forged common name matching the one of the target.
In the next phase of the attack, the attacker would identify the target’s Azure region — this can be done by matching the database domain’s IP to Azure’s public IP ranges — and then create a database in that region.
Once that was done, the attacker could have exploited the first vulnerability on their own instance to escalate privileges and achieve arbitrary code execution. They could then scan the subnet for the targeted instance and exploit the authentication bypass vulnerability to gain read access to the target’s database, which can store sensitive data.
Wiz concluded that “customers of Azure Database for PostgreSQL Flexible Server in any region configured with public network access, regardless of firewall rules, were vulnerable.” Single Server instances or Flexible servers with the explicit VNet network configuration (private access) were not affected.
This is not the first time Wiz researchers have identified potentially serious vulnerabilities in Microsoft cloud services. Last year, they disclosed the details of a Cosmos DB vulnerability they named ChaosDB and an App Service flaw named NotLegit.