Storage Account Shared Key Access Enabled
The storage account accepts requests signed with its account keys, static secrets that give full access to all of its data and bypass Microsoft Entra ID controls.
| Severity | Low |
| CVSS 3.1 | 3.3 CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:N Open in the calculator |
| CVSS 4.0 | 2.1 CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-1220: Insufficient Granularity of Access Control |
| MITRE ATT&CK | T1530 Data from Cloud Storage, T1552.001 Credentials In Files |
| Category | Security Misconfiguration |
Description
Every Azure storage account has two account keys. A request signed with either key (Shared Key authorisation) is given full access to all data in the account's blobs, files, queues and tables, and either key can sign shared access signatures (SAS) that grant any part of that access. The keys are not tied to a user or application, are outside Microsoft Entra ID controls such as multifactor authentication, Conditional Access and role assignments scoped to a single container, and do not expire: they remain valid until they are rotated. Shared Key authorisation is permitted unless the account's AllowSharedKeyAccess property has been explicitly set to false.
Anyone who obtains an account key, from a leaked connection string, a configuration file or a compromised developer workstation, can read, change and delete all data in the account from anywhere the account's network rules allow, without multifactor authentication and without their identity appearing in the logs. During testing, keys and connection strings that contain them are frequently found in application settings, source code, pipeline variables and configuration files.
The keys can also be listed by any principal that holds the Microsoft.Storage/storageAccounts/listkeys/action permission, which common management roles such as Owner, Contributor and Storage Account Contributor include, so a user with management rights over the account can read all of its data through the keys even where no data access role has been assigned to them. The setting does not expose data by itself: an attacker must first obtain a key or hold a management role that can list the keys, and network restrictions on the account limit where a key can be used from. It is read from the account's configuration, for example with az storage account show.
Remediation
Move every client to Microsoft Entra ID authorisation, then disallow Shared Key authorisation:
- Give applications managed identities, or service principals where they run outside Azure, and grant them data roles at the narrowest scope that works, such as Storage Blob Data Reader or Storage Blob Data Contributor on a single container.
- Replace account and service SAS tokens with user delegation SAS tokens, which are signed with Entra ID credentials rather than an account key.
- Find the remaining key-based clients before the change: the account's transaction metrics can be split by authentication type, and its resource logs record how each request was authorised.
- Set Allow storage account key access to Disabled in the account's Configuration settings, and set the property in the templates and scripts that deploy it.
- Prevent recurrence with an Azure Policy assignment that audits or denies storage accounts permitting Shared Key access.
Where some workloads still need keys for now, keep the keys in Azure Key Vault rather than in code or configuration files, rotate both keys on a schedule and immediately after any suspected exposure, restrict the account's network access, and limit which roles can list the keys. Confirm the fix by sending a request signed with an account key and confirming that it is refused, while requests authorised through Entra ID still succeed.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.