Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing Lease Id Validation

cliedeman opened this issue · comments

Which service(blob, file, queue, table) does this issue concern?

blob

Which version of the Azurite was used?

latest as of today

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

docker

What's the Node.js version?

What problem was encountered?

Difference between azure storage account and azure

Steps to reproduce the issue?

Create a least with a non guid id
Azure Error:

The value for one of the HTTP headers is not in the correct format.

If possible, please provide the debug log using the -d parameter, replacing <pathtodebuglog> with an appropriate path for your OS, or review the instructions for docker containers:

-d "<pathtodebuglog>"

Please be sure to remove any PII or sensitive information before sharing!
The debug log will log raw request headers and bodies, so that we can replay these against Azurite using REST and create tests to validate resolution.

Have you found a mitigation/solution?

Use a valid lease id

@cliedeman

Thanks for raising this issue!

To fix this issue we can add validation code for input proposedLeaseId in following functions, to make sure it's GUID:
Blob lease:

public async acquireLease(

public async changeLease(

Container lease:
public async acquireLease(

public async changeLease(

Azurite welcome contribution!
It would be great if you could raise a PR to fix this!