Skip to content
Info disclosure Write-up Advanced

The False Oracle — Azure Functions Padding Oracle Issue

An Azure Functions environment variable exposed a storage SAS token with write permission, allowing an attacker with code execution to overwrite the function package and plant a backdoor. A separate SAS token allowed listing and downloading other users' encrypted function configurations, and an undocumented HTTP endpoint acted as a padding oracle that could have decrypted them, but a flawed unpadding implementation made the oracle non-functional.

polarply Follow

Published on polarply.medium.com

In this blog I present two vulnerabilities I found in the Azure Functions and another very interesting case of a padding oracle, available as an undocumented HTTP endpoint on every Function instance. Initially I was ecstatic about this finding as theoretically it would have allowed me to achieve remote code execution…

polarply, on polarply.medium.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

Azure Functions on Linux run inside a container whose startup is coordinated by an internal component called Init Mesh. That component exposes an HTTP server used during initialisation, and it authenticates callers with an encrypted token supplied in the x-ms-site-restricted-token header. The token is decrypted with the CONTAINER_ENCRYPTION_KEY environment variable, and the request is authorised only if decryption succeeds.

The Function environment also carries a set of environment variables that point at configuration and package storage. Two of them matter here: CONTAINER_START_CONTEXT_SAS_URI, which links to a file in the azcontainers blob storage, and SCM_RUN_FROM_PACKAGE, which points at the Function's code package. The storage account behind these URLs is wawstorageproddm1157, which belongs to Microsoft.

This write-up covers two vulnerabilities found in that environment and a third issue that turned out to be a dead end: a privilege escalation through a writable package SAS token, an information disclosure through readable configuration blobs belonging to other tenants, and an undocumented padding oracle endpoint that was broken by an implementation bug in Microsoft's cryptography code.

From the original on polarply.medium.com

Setup

The starting point was the researcher's earlier work on escaping Docker in Azure Functions, published on Intezer's website, in which a reverse shell was hosted over the Function environment to investigate it. The same environment was reused here: code execution inside a Linux Azure Function instance, plus the Azure CLI for querying blob storage. Reversing was done against the Init Mesh binary present in the Function container.

Finding it

While exploring the Function environment, the researcher noticed the CONTAINER_START_CONTEXT_SAS_URI variable pointing at a file in the azcontainers blob storage under the Microsoft-owned wawstorageproddm1157 account.

From the original on polarply.medium.com

Two things stood out in that environment:

  1. The SCM_RUN_FROM_PACKAGE URL redirected to the Azure Function package, and its SAS token carried a write permission. That means the token can be used to overwrite the Function package.
  2. The Function had access to a blob in the wasstorageproddm1157 storage account, which belongs to Microsoft.

Exploitation

Step 1: Overwrite the Function package (privilege escalation)

Because the SAS token on SCM_RUN_FROM_PACKAGE allowed writes, an attacker with code execution on a Function could replace the Function code package with their own code. Done thoughtfully, the user would not notice the change, and the attacker would have a backdoor that runs on every Function invocation. This is the first vulnerability: escalation of privileges from code execution inside the Function to persistent control of the Function's code.

Step 2: Read the encrypted configuration blob

Accessing the URL from CONTAINER_START_CONTEXT_SAS_URI returned an encrypted version of the configuration file used to initialise the Azure Function.

From the original on polarply.medium.com

The CONTAINER_ENCRYPTION_KEY environment variable decrypts this blob using AES-256.

From the original on polarply.medium.com

The decrypted configuration held many interesting keys, including SCM_RUN_FROM_PACKAGE, and also secrets related to the Function's managed identity. Those secrets would allow spoofing the Function identity outside of that Function.

Step 3: List and download other tenants' configurations

The SAS token was extracted from the URL and used with the Azure CLI to query the azcontainers blob storage. The result was a listing of Azure Function configurations that did not belong to the researcher.

From the original on polarply.medium.com

In the listing, each name field is a different configuration file. The token also allowed downloading these configurations. In encrypted form they had no practical use, so on its own this disclosure had no impact. It becomes interesting only if the matching decryption key, or an oracle that performs decryption, can be found.

Step 4: Find the oracle

The earlier Docker escape research had shown that the Init Mesh HTTP server is verbose. Interacting with it requires passing an encrypted authentication token in the x-ms-site-restricted-token header, and an invalid token produces a verbose error message. In particular, the server reported when the token was malformed, specifically when it had incorrect padding. That behaviour is a padding oracle: with that single bit of information an attacker can decrypt any message passed to the oracle, provided it was encrypted with the matching key.

The server was also reachable from outside the Function through a public endpoint.

From the original on polarply.medium.com

Further reversing of the Init Mesh binary showed that the authentication code decrypts the header with the CONTAINER_ENCRYPTION_KEY environment variable and authorises the request only if decryption succeeds.

Step 5: Plan the chain

The intended attack was:

  1. Download an encrypted configuration belonging to another Function.
  2. Find that Function's URL, so the oracle and the configuration match.
  3. Pass the whole encrypted configuration as x-ms-site-restricted-token and decrypt it byte by byte using the padding oracle.
  4. Use the recovered SCM_RUN_FROM_PACKAGE field to take over the Function, in the same way as the privilege escalation above.

Step 6: The oracle does not cooperate

The researcher tried the attack against a server they controlled, and the oracle did not cooperate. It reported no errors when given a token with invalid padding.

From the original on polarply.medium.com

The expectation was a reply of "Padding is invalid".

Or watch on YouTube
From the original on polarply.medium.com

Step 7: Reverse the unpad routine

Reversing the Init Mesh binary explained the behaviour: the unpadding algorithm was flawed and broken. The researcher had initially assumed the padding algorithm worked as intended and had not spent time reverse engineering it. The reconstructed unpad code is:

Text
func [redacted](data []byte) (byte[], error) {  // Check that last byte isn’t zero  if data[len(data)-1] != 0 {    // Check that last byte is bigger than message total length    data[len(data)-1] > len(data) {    return nil    }  }  return fmt.Errorf(“Padding is invalid”)}

For comparison, a real unpad implementation:

Text
func Unpad(data []byte, blockSize uint) ([]byte, error) {  if blockSize < 1 {    return nil, fmt.Errorf(“Block size looks wrong”)  }  if uint(len(data))%blockSize != 0 {    return nil, fmt.Errorf(“Data isn’t aligned to blockSize”)  }  if len(data) == 0 {    return nil, fmt.Errorf(“Data is empty”)  }  paddingLength := int(data[len(data)-1])  for _, el := range data[len(data)-paddingLength:] {    if el != byte(paddingLength) {      return nil, fmt.Errorf(“Padding had malformed entries. Have ‘%x’, expected ‘%x’”, paddingLength, el)    }  }  return data[:len(data)-paddingLength], nil}

The unpadding routine was flawed and broken, so the oracle did not behave as expected. With no distinguishable response for valid and invalid padding, the oracle is a false oracle, and the decryption attack cannot proceed. Two minuses made a plus: the flaw in the cryptography code neutralised the exposure of the endpoint.

Root cause

Three separate design and implementation problems combined:

  • The SAS token issued for SCM_RUN_FROM_PACKAGE carried write permission, so a party with code execution inside the Function could replace the package it runs from.
  • The SAS token found in the environment allowed listing and reading configuration blobs beyond the Function's own, so encrypted configurations of other Functions were exposed.
  • The Init Mesh authentication endpoint was reachable publicly and returned verbose errors when the token was malformed, specifically when it had incorrect padding. The oracle was rendered harmless by a bug in the unpad routine.

Impact

  • Privilege escalation: an attacker with code execution on a Linux Azure Function could overwrite the code package through the writable SAS token and plant a backdoor that runs on every invocation, without the user noticing.
  • Information disclosure: an attacker could list and download encrypted configuration files of other Azure Functions. In encrypted form these had no practical impact on their own. The decrypted configuration contained SCM_RUN_FROM_PACKAGE and managed identity secrets, which would allow spoofing the Function identity outside the Function.
  • Remote code execution (not achieved): chaining the disclosure with the padding oracle would have allowed decrypting other users' configurations and taking over their Functions. The broken unpad routine prevented this. Even had the oracle worked, the attack required matching each oracle (the Function URL) to its configuration, which probably would have limited its impact.

Fix

Microsoft changed the scope of the SAS tokens so that apps cannot read encrypted configurations that do not belong to them, and restricted the permissive rw storage token that enabled the privilege escalation. The padding oracle was reported, but because the component was inoperative the Azure security team decided not to change it.

Variants to test

  • Writable package SAS tokens: inspect SCM_RUN_FROM_PACKAGE and similar environment variables in other serverless or container platforms for SAS tokens with write or delete permissions. A positive result is a token that lets you overwrite the deployed package and observe your code running on the next invocation.
  • Over-broad blob SAS tokens: take any SAS URL found in an environment and try listing the container with the Azure CLI. A positive result is a listing that includes names you do not own.
  • Encrypted configuration blobs: look for configuration files encrypted with a key that is also present in the environment. A positive result is a blob you can decrypt locally and that contains credentials or identity secrets.
  • Verbose authentication endpoints: probe internal HTTP servers for error messages that differ between malformed and well-formed tokens, especially messages mentioning padding, block size or alignment. A positive result is a response that changes with the padding validity of a chosen ciphertext.
  • Public exposure of internal endpoints: check whether the Init Mesh style server is reachable from outside the instance.
  • Oracle-to-target matching: when a padding oracle exists, confirm whether the key used by the oracle matches the key protecting the data you want to decrypt.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 18 min read.

What happened, in plain words

This is the story of two real security holes found in Microsoft's Azure Functions service, and one very promising attack that turned out to be impossible because of a bug in Microsoft's own code.

Azure Functions is a service where you upload a small piece of code (a "Function") and Microsoft runs it for you on its servers whenever something needs to happen. You do not manage the server; Microsoft does. Each Function runs inside a container, which is a sealed-off box on a shared machine, so that one customer's code cannot see or touch another customer's code.

The researcher who wrote this report had already published earlier work on breaking out of that box (a "Docker escape"). Here they went back into the same environment and looked around more carefully. They found:

  1. A way for someone who already has code running inside a Function to quietly replace the Function's own code with their own, so that a backdoor runs every time the Function is called. This is a privilege escalation: going from "I can run code here" to "I permanently control what code runs here".
  2. A way to list and download the (encrypted) configuration files of other people's Functions, which should never have been visible.
  3. A hidden web endpoint on every Function that behaved like a "padding oracle", a classic cryptographic weakness that can be used to decrypt secret data without knowing the key. This looked like it would let the researcher decrypt other people's configurations and take over their Functions. But when they tried it, the endpoint never gave the error it was supposed to give, because the code that checks the padding was written incorrectly. The oracle was broken, so the attack could not work.

All of this was reported to Microsoft's security response team (MSRC). The first two issues were fixed. The third was reported but left alone, because the component was inoperative.

From the original on polarply.medium.com

The pieces you need to know first

Before the steps make sense, here are the ideas the report relies on, explained from scratch.

A server, a client and an API. When you use a website or an app, your device (the client) sends a request over the internet to a computer somewhere (the server), and the server sends back a response. An API is simply the set of addresses and rules a server offers so that programs, not just humans with browsers, can ask it to do things. Think of a restaurant: the menu is the API, the waiter takes your order, the kitchen is the server.

Environment variables. When a program starts on a computer, the operating system can hand it a list of named settings, like HOME=/home/you or LANG=en_GB. These are environment variables. Programs read them to find out where things are, what keys to use, and so on. They are like sticky notes attached to a process when it starts.

Blob storage. Cloud providers offer a service for storing files as plain objects, called blobs. You put a file in a container (a folder-like grouping) inside a storage account (the top-level bucket that belongs to one owner). Each blob has a URL you can fetch it from.

SAS tokens. A SAS (Shared Access Signature) token is a long string added to the end of a storage URL that grants limited permission to that storage: for example, "you may read this one file for the next hour". It is like a visitor badge that says which rooms you may enter and until when. Crucially, a SAS token can also grant write permission, which means the holder can replace the file.

Encryption and keys. Encryption scrambles data so that only someone with the right key can unscramble it. AES-256 is a widely used encryption standard. If you have the key, decryption is easy; without it, it should be practically impossible.

Padding. Encryption works on fixed-size chunks called blocks. If your message is not an exact multiple of the block size, the software adds a few extra bytes at the end to fill the last block. Those extra bytes are called padding, and they follow a rule (for example, "the last N bytes all have the value N"). When decrypting, the software checks that the padding follows the rule. If it does not, the message is considered malformed.

A padding oracle. An oracle, in security, is any system that answers a yes/no question about secret data. A padding oracle is a server that tells you, through an error message or a different response, whether the padding of a piece of encrypted data you sent was valid. That sounds harmless, but it is not: by sending carefully crafted variations and watching which ones the server accepts, an attacker can decrypt the whole message byte by byte, without ever knowing the key. It is like guessing a locked combination by listening for a tiny click on each dial.

Privilege escalation. Starting with limited permission and ending with more. Here: starting with the ability to run code inside a Function, ending with the ability to control what code the Function runs permanently.

Remote code execution (RCE). Getting your own code to run on someone else's machine. It is the most serious outcome in this kind of research.

Reverse engineering. Taking a compiled program and working out what it does, often by reading its instructions and strings. The researcher did this on a program called Init Mesh, which is the internal component that starts up the Function container.

Setting the scene

Azure Functions on Linux run inside a container. The startup of that container is coordinated by an internal component called Init Mesh. Init Mesh runs a small HTTP server (a web server that answers requests) used during initialisation. To use it, a caller must send an encrypted token in an HTTP header called x-ms-site-restricted-token. A header is a labelled line of extra information attached to a web request, like the "From" line on an envelope. The server decrypts that token using the CONTAINER_ENCRYPTION_KEY environment variable, and only lets the request through if decryption succeeds.

The Function environment also carries environment variables that point at storage. Two matter here:

  • CONTAINER_START_CONTEXT_SAS_URI, which links to a file in the azcontainers blob storage.
  • SCM_RUN_FROM_PACKAGE, which points at the Function's code package (the zip of code that the Function runs).

The storage account behind these URLs is wawstorageproddm1157, which belongs to Microsoft.

This write-up covers two vulnerabilities found in that environment and a third issue that turned out to be a dead end: a privilege escalation through a writable package SAS token, an information disclosure through readable configuration blobs belonging to other tenants, and an undocumented padding oracle endpoint that was broken by an implementation bug in Microsoft's cryptography code.

How the researcher got in

The starting point was the researcher's earlier work on escaping Docker in Azure Functions, published on Intezer's website. In that work, a reverse shell was hosted over the Function environment to investigate it. A reverse shell is a program that connects back out to the attacker's machine and gives them a command prompt on the target. The same environment was reused here: code execution inside a Linux Azure Function instance, plus the Azure CLI (Microsoft's command-line tool for managing Azure resources) for querying blob storage. Reversing was done against the Init Mesh binary present in the Function container.

Finding it

While exploring the Function environment, the researcher noticed the CONTAINER_START_CONTEXT_SAS_URI variable pointing at a file in the azcontainers blob storage under the Microsoft-owned wawstorageproddm1157 account.

From the original on polarply.medium.com

Two things stood out in that environment:

  1. The SCM_RUN_FROM_PACKAGE URL redirected to the Azure Function package, and its SAS token carried a write permission. That means the token can be used to overwrite the Function package.
  2. The Function had access to a blob in the wasstorageproddm1157 storage account, which belongs to Microsoft.

Exploitation

Step 1: Overwrite the Function package (privilege escalation)

Because the SAS token on SCM_RUN_FROM_PACKAGE allowed writes, an attacker with code execution on a Function could replace the Function code package with their own code. Done thoughtfully, the user would not notice the change, and the attacker would have a backdoor that runs on every Function invocation. This is the first vulnerability: escalation of privileges from code execution inside the Function to persistent control of the Function's code.

Why this matters: the attacker already had code running, but only for as long as their session lasted. By replacing the package, they make their code the code the Function runs from then on, every time it is triggered. The owner sees a Function that still works; they do not see that it now also does something else.

Step 2: Read the encrypted configuration blob

Accessing the URL from CONTAINER_START_CONTEXT_SAS_URI returned an encrypted version of the configuration file used to initialise the Azure Function.

From the original on polarply.medium.com

The CONTAINER_ENCRYPTION_KEY environment variable decrypts this blob using AES-256.

From the original on polarply.medium.com

The decrypted configuration held many interesting keys, including SCM_RUN_FROM_PACKAGE, and also secrets related to the Function's managed identity. Those secrets would allow spoofing the Function identity outside of that Function.

A managed identity is a cloud account that a service is given so it can talk to other cloud services without a password in the code. If you steal its secrets, you can pretend to be that Function when talking to other Microsoft services, from anywhere.

Step 3: List and download other tenants' configurations

The SAS token was extracted from the URL and used with the Azure CLI to query the azcontainers blob storage. The result was a listing of Azure Function configurations that did not belong to the researcher.

From the original on polarply.medium.com

In the listing, each name field is a different configuration file. The token also allowed downloading these configurations. In encrypted form they had no practical use, so on its own this disclosure had no impact. It becomes interesting only if the matching decryption key, or an oracle that performs decryption, can be found.

Think of it as finding a drawer full of locked boxes belonging to other people. You cannot open them, but you now know they exist and you have the drawer key. If you can find a way to open one box, you have that person's secrets.

Step 4: Find the oracle

The earlier Docker escape research had shown that the Init Mesh HTTP server is verbose. Interacting with it requires passing an encrypted authentication token in the x-ms-site-restricted-token header, and an invalid token produces a verbose error message. In particular, the server reported when the token was malformed, specifically when it had incorrect padding. That behaviour is a padding oracle: with that single bit of information an attacker can decrypt any message passed to the oracle, provided it was encrypted with the matching key.

The server was also reachable from outside the Function through a public endpoint.

From the original on polarply.medium.com

Further reversing of the Init Mesh binary showed that the authentication code decrypts the header with the CONTAINER_ENCRYPTION_KEY environment variable and authorises the request only if decryption succeeds.

This is the key connection: the same key that decrypts the configuration blob also decrypts the token the oracle checks. So if the oracle can be used to decrypt a token, it can be used to decrypt a configuration.

Step 5: Plan the chain

The intended attack was:

  1. Download an encrypted configuration belonging to another Function.
  2. Find that Function's URL, so the oracle and the configuration match.
  3. Pass the whole encrypted configuration as x-ms-site-restricted-token and decrypt it byte by byte using the padding oracle.
  4. Use the recovered SCM_RUN_FROM_PACKAGE field to take over the Function, in the same way as the privilege escalation above.

Why each step: step 1 gives you the locked box. Step 2 gives you the lock that opens it, because the oracle only works with the key of the Function it belongs to. Step 3 is the slow, patient work of turning yes/no answers into plaintext. Step 4 turns the plaintext into control.

Step 6: The oracle does not cooperate

The researcher tried the attack against a server they controlled, and the oracle did not cooperate. It reported no errors when given a token with invalid padding.

From the original on polarply.medium.com

The expectation was a reply of "Padding is invalid".

Or watch on YouTube
From the original on polarply.medium.com

Without a different response for good and bad padding, there is no signal to listen to. The oracle is silent, and a silent oracle is useless.

Step 7: Reverse the unpad routine

Reversing the Init Mesh binary explained the behaviour: the unpadding algorithm was flawed and broken. The researcher had initially assumed the padding algorithm worked as intended and had not spent time reverse engineering it. The reconstructed unpad code is:

Text
func [redacted](data []byte) (byte[], error) {  // Check that last byte isn’t zero  if data[len(data)-1] != 0 {    // Check that last byte is bigger than message total length    data[len(data)-1] > len(data) {    return nil    }  }  return fmt.Errorf(“Padding is invalid”)}

Line by line, in plain words:

  • func [redacted](data []byte) (byte[], error) { declares a function that takes some bytes and returns either some bytes or an error. The name suggests it is meant to remove PKCS#7 padding, the standard padding scheme.
  • // Check that last byte isn’t zero is a comment describing the intent.
  • if data[len(data)-1] != 0 { looks at the last byte of the data and asks whether it is not zero.
  • // Check that last byte is bigger than message total length is another comment.
  • data[len(data)-1] > len(data) { is a comparison written as if it were a statement. It does not assign anything, does not branch, and does not return. It is not valid logic for a check.
  • return nil would return nothing, but it sits inside a block that is never properly entered.
  • } closes the block.
  • return fmt.Errorf(“Padding is invalid”) returns the padding error, but only on the path that is never reached in practice.

The result is that the function does not report invalid padding as intended.

For comparison, a real unpad implementation:

Text
func Unpad(data []byte, blockSize uint) ([]byte, error) {  if blockSize < 1 {    return nil, fmt.Errorf(“Block size looks wrong”)  }  if uint(len(data))%blockSize != 0 {    return nil, fmt.Errorf(“Data isn’t aligned to blockSize”)  }  if len(data) == 0 {    return nil, fmt.Errorf(“Data is empty”)  }  paddingLength := int(data[len(data)-1])  for _, el := range data[len(data)-paddingLength:] {    if el != byte(paddingLength) {      return nil, fmt.Errorf(“Padding had malformed entries. Have ‘%x’, expected ‘%x’”, paddingLength, el)    }  }  return data[:len(data)-paddingLength], nil}

Line by line:

  • func Unpad(data []byte, blockSize uint) ([]byte, error) { declares a function that takes the data and the block size, and returns the unpadded data or an error.
  • if blockSize < 1 { return nil, fmt.Errorf(“Block size looks wrong”) } rejects a nonsense block size.
  • if uint(len(data))%blockSize != 0 { return nil, fmt.Errorf(“Data isn’t aligned to blockSize”) } checks that the data length is a whole number of blocks. If not, something is wrong.
  • if len(data) == 0 { return nil, fmt.Errorf(“Data is empty”) } rejects empty input.
  • paddingLength := int(data[len(data)-1]) reads the last byte, which in PKCS#7 says how many padding bytes there are.
  • for _, el := range data[len(data)-paddingLength:] { walks over the last paddingLength bytes.
  • if el != byte(paddingLength) { return nil, fmt.Errorf(“Padding had malformed entries. Have ‘%x’, expected ‘%x’”, paddingLength, el) } checks that every one of those bytes equals the padding length. If any does not, it returns an error. This is exactly the signal a padding oracle needs.
  • return data[:len(data)-paddingLength], nil returns the data with the padding removed.

The unpadding routine was flawed and broken, so the oracle did not behave as expected. With no distinguishable response for valid and invalid padding, the oracle is a false oracle, and the decryption attack cannot proceed. Two minuses made a plus: the flaw in the cryptography code neutralised the exposure of the endpoint.

Why it happened

Three separate design and implementation problems combined:

  • The SAS token issued for SCM_RUN_FROM_PACKAGE carried write permission, so a party with code execution inside the Function could replace the package it runs from.
  • The SAS token found in the environment allowed listing and reading configuration blobs beyond the Function's own, so encrypted configurations of other Functions were exposed.
  • The Init Mesh authentication endpoint was reachable publicly and returned verbose errors when the token was malformed, specifically when it had incorrect padding. The oracle was rendered harmless by a bug in the unpad routine.

What the impact was

  • Privilege escalation: an attacker with code execution on a Linux Azure Function could overwrite the code package through the writable SAS token and plant a backdoor that runs on every invocation, without the user noticing.
  • Information disclosure: an attacker could list and download encrypted configuration files of other Azure Functions. In encrypted form these had no practical impact on their own. The decrypted configuration contained SCM_RUN_FROM_PACKAGE and managed identity secrets, which would allow spoofing the Function identity outside the Function.
  • Remote code execution (not achieved): chaining the disclosure with the padding oracle would have allowed decrypting other users' configurations and taking over their Functions. The broken unpad routine prevented this. Even had the oracle worked, the attack required matching each oracle (the Function URL) to its configuration, which probably would have limited its impact.

What Microsoft changed

Microsoft changed the scope of the SAS tokens so that apps cannot read encrypted configurations that do not belong to them, and restricted the permissive rw storage token that enabled the privilege escalation. The padding oracle was reported, but because the component was inoperative the Azure security team decided not to change it.

What to look for in your own systems

These are the checks the report suggests, written so you can follow them even if you are new.

  • Writable package SAS tokens: inspect SCM_RUN_FROM_PACKAGE and similar environment variables in other serverless or container platforms for SAS tokens with write or delete permissions. A positive result is a token that lets you overwrite the deployed package and observe your code running on the next invocation.
  • Over-broad blob SAS tokens: take any SAS URL found in an environment and try listing the container with the Azure CLI. A positive result is a listing that includes names you do not own.
  • Encrypted configuration blobs: look for configuration files encrypted with a key that is also present in the environment. A positive result is a blob you can decrypt locally and that contains credentials or identity secrets.
  • Verbose authentication endpoints: probe internal HTTP servers for error messages that differ between malformed and well-formed tokens, especially messages mentioning padding, block size or alignment. A positive result is a response that changes with the padding validity of a chosen ciphertext.
  • Public exposure of internal endpoints: check whether the Init Mesh style server is reachable from outside the instance.
  • Oracle-to-target matching: when a padding oracle exists, confirm whether the key used by the oracle matches the key protecting the data you want to decrypt.

Glossary

  • API: the set of addresses and rules a server offers so that programs can ask it to do things.
  • AES-256: a widely used standard for encrypting data with a 256-bit key.
  • Azure CLI: Microsoft's command-line tool for managing Azure resources.
  • Azure Functions: Microsoft's service that runs small pieces of code on demand, without the customer managing a server.
  • Backdoor: code hidden in a system that lets an attacker keep control or access later.
  • Blob: a file stored as a plain object in cloud storage.
  • Blob storage: a cloud service for storing files as blobs inside containers inside storage accounts.
  • Block: a fixed-size chunk of data that encryption works on.
  • Container (Docker): a sealed-off box on a machine that runs one program with its own view of the system.
  • Container (storage): a folder-like grouping inside a storage account that holds blobs.
  • Ciphertext: data that has been encrypted.
  • Code execution: the ability to make your own code run on a machine.
  • Configuration file: a file that holds settings a program reads at startup.
  • CONTAINER_ENCRYPTION_KEY: the environment variable holding the key used to decrypt the Function's configuration blob and the Init Mesh authentication token.
  • CONTAINER_START_CONTEXT_SAS_URI: the environment variable holding a URL with a SAS token that points at the Function's encrypted configuration blob.
  • Decryption: turning encrypted data back into readable data using the right key.
  • Docker escape: breaking out of a container so that you reach the machine underneath.
  • Encryption: scrambling data so that only someone with the right key can read it.
  • Environment variable: a named setting the operating system hands to a program when it starts.
  • Header: a labelled line of extra information attached to a web request or response.
  • HTTP server: a program that answers web requests.
  • Information disclosure: a flaw that lets someone see data they should not see.
  • Init Mesh: the internal component that coordinates the startup of an Azure Function container.
  • Invocation: one call to a Function, which causes its code to run once.
  • Key: the secret value used to encrypt and decrypt data.
  • Managed identity: a cloud account given to a service so it can talk to other cloud services without a password in code.
  • MSRC: Microsoft Security Response Center, the team that receives and handles security reports about Microsoft products.
  • Oracle: any system that answers a yes/no question about secret data.
  • Padding: extra bytes added to the end of a message so it fills a whole number of blocks, following a rule.
  • Padding oracle: a server that reveals, through its responses, whether the padding of encrypted data you sent was valid, which lets an attacker decrypt the data byte by byte.
  • PKCS#7: a standard rule for how padding bytes are formed and checked.
  • Plaintext: readable, unencrypted data.
  • Privilege escalation: going from limited permission to more permission than you should have.
  • Public endpoint: an address on the internet that anyone can reach, not just the internal system.
  • Reverse engineering: working out what a compiled program does by reading its instructions and data.
  • Reverse shell: a program that connects back out to an attacker and gives them a command prompt on the target.
  • SAS token: a long string added to a storage URL that grants limited permission, such as read or write, for a period of time.
  • SCM_RUN_FROM_PACKAGE: the environment variable holding a URL with a SAS token that points at the Function's code package.
  • Secrets: values such as passwords, keys or tokens that must be kept private.
  • Serverless: a way of running code where the provider manages the servers and you only supply the code.
  • Spoofing: pretending to be something or someone you are not.
  • Storage account: the top-level bucket in cloud storage that belongs to one owner.
  • Tenant: one customer's isolated space in a cloud service.
  • Token: a string that proves identity or grants permission, like a ticket or a badge.
  • Unpad: the step of removing padding after decryption and checking that it followed the rule.
  • Vulnerability: a weakness in a system that an attacker can use to do something harmful.
  • x-ms-site-restricted-token: the HTTP header in which the Init Mesh server expects its encrypted authentication token.
  • wawstorageproddm1157: the Microsoft-owned storage account that held the Function configuration blobs described here.

More from Microsoft

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.