Skip to content
Access control Write-up Beginner

Exploiting Azure Queue Storage Unexpired Sas Token With Excessive Permission

A publicly exposed Azure Queue Storage SAS URL granted excessive permissions and had a very long expiry, allowing an attacker to list queues, read messages, create queues and insert messages. The author demonstrated these operations using the leaked token.

Sahad Mk Follow

Published on systemweakness.com

This write-up helps you understand the Shared Access Signature, aka SAS, and how to exploit a storage resource using a SAS token. In the final section, you will get to know how to prevent an attacker from abusing our SAS token.

Sahad Mk, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the SAS token was over-permissioned and had an excessively long expiry, and it was exposed in a publicly accessible URL.

Impact

An attacker with the leaked SAS token could read, write, list, create and update queue messages, potentially disrupting or manipulating the queue service.

What the attacker needed

A leaked SAS URL for a queue; The SAS token has excessive permissions; The SAS token has a long expiry

The fix

The SAS token should be scoped to the minimum required permissions and a short expiry, and if compromised, the associated access keys should be rotated.

How it was found

  1. Find a queue storage endpoint via GitHub search and Google dork.
  2. Open the SAS URL and confirm it returns queue messages.
  3. Analyse the SAS token parameters to see permissions and expiry.
  4. Use the Azure CLI with the SAS token to list queues.
  5. Retrieve messages from a queue.
  6. Create a new queue and insert a message.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A SAS token is like a temporary password that lets someone access part of a cloud storage account. Here, a token was found in a public URL and it allowed far more actions than needed, and it would not expire for many years. Anyone who found the link could read and write messages in the storage queue.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.