Fixed constant identifiable credential Security Issue#2671
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates Azurite’s internal mechanism for generating/validating user delegation SAS signatures by replacing a hardcoded, high-entropy “key-like” constant with a deterministic, explicitly non-secret seed string (to reduce false positives from secret scanning while keeping signatures stable within a given Azurite version).
Changes:
- Replace
USERDELEGATIONKEY_BASIC_KEYwithUSERDELEGATIONKEY_SIGNING_SEEDin blob utils constants. - Update HMAC signing in
getUserDelegationKeyValue()to use the new seed constant. - Document the change in
ChangeLog.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/blob/utils/utils.ts | Switch user delegation key signature HMAC input from the old constant to the new deterministic seed constant. |
| src/blob/utils/constants.ts | Remove the hardcoded key-like literal and introduce USERDELEGATIONKEY_SIGNING_SEED with updated inline documentation. |
| ChangeLog.md | Note the replacement of the hardcoded signing key literal with a deterministic internal seed to avoid secret-scan blocks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ].join("\n"); | ||
|
|
||
| return createHmac("sha256", USERDELEGATIONKEY_BASIC_KEY).update(stringToSign, "utf8").digest("base64"); | ||
| return createHmac("sha256", USERDELEGATIONKEY_SIGNING_SEED).update(stringToSign, "utf8").digest("base64"); |
Comment on lines
+175
to
+178
| // Deterministic, non-secret string used directly as HMAC key material by | ||
| // getUserDelegationKeyValue() when producing user delegation key values. | ||
| // It must stay stable so signatures remain consistent across instances and | ||
| // restarts. |
| - Remove the deprecated `azure-storage` dev dependency and migrate the affected queue and table test suites to `@azure/data-tables` and other modern Azure SDK clients (adds `@azure/identity`). | ||
| - Standardize binary data handling on `Uint8Array` instead of `Buffer` (e.g. MD5 hashes, Content-MD5, internal buffer conversions). | ||
| - Fix Windows SEA executable build producing a corrupted/bad `.exe` by stripping the Authenticode signature from the copied Node.js binary before injecting the SEA blob via `postject`. | ||
| - Replace the hardcoded user delegation signing key literal with a deterministic internal signing seed to avoid VS Code extension publish secret-scan blocks while preserving stable user delegation SAS behavior. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates how the emulator internally derives signing keys for user delegation SAS tokens. Instead of using a fixed, hardcoded secret key, the code now uses a deterministic, non-secret seed string. This improves security by making it clear the value is not a credential and avoids false positives from security scanners.
Key changes:
Security and Key Management:
USERDELEGATIONKEY_BASIC_KEYwith a deterministic, non-secretUSERDELEGATIONKEY_SIGNING_SEEDinconstants.ts, clarifying that the value is not a credential and should remain stable for consistent signatures.utils.ts) to useUSERDELEGATIONKEY_SIGNING_SEEDinstead of the previous hardcoded key when generating user delegation key signatures. [1] [2]