Repository navigation
Harden embedded catalog credential encoding - #124
Open
mitch030504 wants to merge 1 commit into
Open
mitch030504 wants to merge 1 commit into
mitch030504 wants to merge 1 commit into
Conversation
Replace the fixed XOR mask with a versioned AES-256-GCM envelope that uses a random salt and nonce per build. A plain string search no longer reveals the key, and one extracted decoder no longer decodes every build with the same mask. The payload authenticates with GCM, so a tampered bundle fails instead of producing a corrupt key. Tests cover round-trip, per-build uniqueness, plaintext absence, tampering and unknown formats. This remains obfuscation, not secrecy: the decoder ships with the app and the key is recoverable from a running process. See the comment in src/shared/keyObfuscation.ts.
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.
Summary
Replace the fixed XOR mask used to embed the vrSrc catalog credential with a versioned AES-256-GCM envelope.
fcbk1:<salt>:<nonce>:<tag+ciphertext>in base64url.Security scope
This is obfuscation, not secrecy. The decoder ships with the app and the key is recoverable from a running process. The comment in
src/shared/keyObfuscation.tssays so explicitly. The change only raises the cost of lifting the embedded credential from a released bundle.Tests
src/shared/keyObfuscation.test.tscovers round-trip decoding, per-build uniqueness, absence of plaintext, tamper rejection, and unsupported/malformed formats.npm testpasses with the new tests. The branch is based on upstreammainat v1.9.0.