Exposing an ASP.NET Core appsettings.json file containing Azure Active Directory (Azure AD) credentials poses a critical attack vector, effectively handing adversaries the keys to an organization’s cloud environment.
During a recent cybersecurity assessment by Resecurity’s HUNTER Team, researchers discovered that a publicly accessible appsettings.json file had exposed the ClientId and ClientSecret of an Azure AD application, allowing any attacker to authenticate directly against Microsoft’s OAuth 2.0 endpoints and act as a trusted application.
With the leaked ClientId and ClientSecret, attackers can request OAuth 2.0 tokens via the Client Credentials flow, obtaining a Bearer token that grants access to Microsoft Graph APIs. Depending on the application’s assigned Graph permissions, this token enables:
Because the file was served without access controls, any automated scan or determined adversary could harvest these secrets and immediately compromise cloud accounts, exfiltrate data, or move laterally into production services.
This vulnerability typifies common misconfigurations and poor secrets management in cloud-native apps. In local development, developers often store sensitive values—such as ClientId, ClientSecret, storage keys, or database passwords—in plain configuration files. Problems arise when:
Anatomy of the Leak
In ASP.NET Core applications, appsettings.json is the primary configuration file, storing connection strings, API keys, cloud credentials, logging settings, feature flags, and, in the AzureAd section, fields like Instance, TenantId, ClientId, RedirectUri, and ClientSecret.
When publicly accessible, these values become a launchpad for adversaries to impersonate legitimate applications.
With these capabilities, adversaries can exfiltrate data, escalate privileges, register rogue applications for persistent access, and even tamper with cloud resources.
Organizations must enforce strict file-access controls, exclude configuration files from public hosting, and adopt robust secret management practices.
Migrating secrets to secure vaults, integrating automated scanning for exposed credentials, conducting regular penetration tests, and enforcing least-privilege Graph permissions will greatly reduce the risk of such leaks.
Find this Story Interesting! Follow us on LinkedIn and X to Get More Instant Updates.
Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…
Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…
Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…
A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…
GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…
Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…