Skip to content

SDK rewrites SAS timestamps if they aren't in an exact format, which breaks signature verification #168

@AtOMiCNebula

Description

@AtOMiCNebula

Which version of the SDK was used?

0.7.0 (via AzCopy/Storage Explorer), also 0.8.0

Which platform are you using? (ex: Windows, Linux, Debian)

Windows, though I'd expect this issue to be platform-independent

What problem was encountered?

The Go SDK's SAS handling code rewrites the SAS timestamps, which causes signature verification on the server side to fail.

How can we reproduce the problem in the simplest way?

The List Service SAS endpoint (https://docs.microsoft.com/en-us/rest/api/storagerp/storageaccounts/listservicesas), as well as probably others, currently generate timestamps with sub-second precision. Even if you pass an expiration date without sub-second precision to the API, the service generates the signature with a timestamp that uses sub-second precision. This SAS is then unusable with the Go SDK (and by proxy, AzCopy and Azure Storage Explorer)

Have you found a mitigation/solution?

No mitigation, but I will be opening a PR to resolve this shortly. The original timestamp string needs to be retained, instead of expecting a Time to roundtrip cleanly.

I found my way here via Azure/azure-storage-azcopy#122!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions