Application Security

CSRF Vulnerability in Kudu SCM Allowed Code Execution in Azure Services

A CSRF vulnerability in the source control management (SCM) service Kudu could be exploited to achieve remote code execution in multiple Azure services.

A CSRF vulnerability in the source control management (SCM) service Kudu could be exploited to achieve remote code execution in multiple Azure services.

A cross-site request forgery (CSRF) vulnerability impacting the source control management (SCM) service Kudu could be exploited to achieve remote code execution (RCE) in multiple Azure services, cloud infrastructure security firm Ermetic has discovered.

A web-based Git repository manager, Kudu is the engine behind several Azure App Service features, supporting the deployment and management of code in Azure. The service is used by Functions, App Service, Logic Apps, and other Azure services.

Administrators can manage Azure applications from the SCM panel, which uses Kudu and which requires Azure Active Directory (AAD) authentication. The SCM panel is deployed by default by the App Service, Function Apps, and Logic Apps Azure services.

“If the user has authenticated to their Microsoft account through the browser, they can simply navigate to the SCM panel and log in. Otherwise, they need to log in manually with their Microsoft authorized credentials,” Ermetic notes.

The CSRF vulnerability in Kudu could be exploited to deploy a malicious ZIP file to the victim’s Azure application, which could result in code execution and application takeover. Ermetic calls the attack EmojiDeploy.

Successful exploitation of the security defect could allow an attacker to run code as the www user, steal or tamper with sensitive data, launch phishing campaigns, and even move laterally to other Azure services.

“The vulnerability enables RCE and full takeover of the target app. The impact of the vulnerability on the organization as a whole depends on the permissions of the applications managed identity. Effectively applying the principle of least privilege can significantly limit the blast radius,” Ermetic notes.

According to Ermetic, attackers targeting the vulnerability would need to exploit a same-site misconfiguration, to bypass an origin check, and then exploit a vulnerable endpoint, which would eventually lead to RCE.

Advertisement. Scroll to continue reading.

Specifically, Ermetic discovered that the Same-Site attribute for the SCM panel’s cookie was set to “None”, meaning that no protection was being offered against cross-origin attacks, and that the SCM server would accept requests containing special characters, leading to cross-origin protections bypass.

“This finding allows an attacker to create a wildcard DNS record for his own domain and send cross-origin requests with special characters that eventually will be accepted by the server origin check,” Ermetic explains.

The researchers also discovered that, when processing requests to the ZIP ‘deploy to application’ feature available through the SCM, the server does not validate or require the headers sent by the client, which would bypass existing CSRF mitigations.

“After some investigation, the SCM Server in this particular zipdeploy endpoint accepts text/plain Mime-types. We can encode our zip payload and use text/plain for CSRF,” Ermetic notes.

The EmojiDeploy attack can be performed via a browser, but exploitation of the vulnerability requires for the attacker to have SCM or Microsoft account cookies in their browser.

The vulnerability was reported to Microsoft in October 2022 and the tech giant addressed it in December through stronger origin checks on the server and by changing the same-site cookie value to ‘Lax’. Microsoft awarded a $30,000 bug bounty for the issue.

Related: Azure Services SSRF Vulnerabilities Exposed Internal Endpoints, Sensitive Data

Related: Microsoft Patches Azure Cross-Tenant Data Access Flaw

Related: Microsoft Patches Vulnerability Allowing Full Access to Azure Service Fabric Clusters

Related Content

Cloud Security

An active cloud account takeover campaign has impacted dozens of Azure environments and compromised hundreds of user accounts.

Vulnerabilities

Microsoft provided guidance on an Azure CLI bug leading to the exposure of sensitive information through GitHub Actions logs.

Cloud Security

Orca Security details eight XSS vulnerabilities in Azure HDInsight that could lead to information leaks, session hijacking, and payload delivery.

Management & Strategy

A critical Microsoft Power Platform vulnerability exposed authentication data and other secrets, but the tech giant has been accused of handling it poorly.

Cloud Security

Cloud security researcher warns that stolen Microsoft signing key was more powerful and not limited to Outlook.com and Exchange Online.

Cloud Security

Businesses using ‘Log in with Microsoft’ could be exposed to privilege escalation and full account takeover exploits.

Cloud Security

Microsoft Azure shared key authorization can be exploited to access business data and achieve remote code execution.

Cloud Security

An Azure Active Directory (AAD) misconfiguration leading to Bing.com compromise earned Wiz researchers a $40,000 bug bounty reward.

Copyright © 2024 SecurityWeek ®, a Wired Business Media Publication. All Rights Reserved.

Exit mobile version