This repository was archived by the owner on Nov 5, 2026. It is now read-only.
Repository navigation
Conversation
…alidation ### Description This PR addresses critical secrets management and data handling vulnerabilities within the `linera-web` extension. Previously, the extension background script hardcoded a private key literal, silently ignored uploaded wallet files, and retained unvalidated JSON structures in memory. This update removes all embedded key material, strictly validates the shape of imported wallet metadata, and ensures only safe, non-sensitive chain identifiers are retained. **Vulnerabilities & Security Defects Remediated:** * **Embedded Private Key Removal (`linera-web/extension/src/wallet/index.ts`):** Removed the hardcoded `PrivateKey` literal from the `Server::setWallet` flow. The browser client is now safely disposed of and fails closed if a supported initialization path is unavailable, rather than defaulting to an insecure embedded key[cite: 2]. * **Strict Metadata Validation & Redaction (`linera-web/extension/src/wallet/index.ts`):** Implemented `parseWalletMetadata` to strictly validate uploaded JSON. The extension now discards the raw file contents and only retains the `default` chain identifier in memory[cite: 2]. * **Explicit Error Handling (`linera-web/extension/src/sidebar/index.ts`, `linera-web/extension/src/wallet/index.ts`):** Client query failures and malformed wallet uploads are now caught and returned explicitly as errors through the message bridge, preventing uncaught promise rejections and silent UI failures[cite: 2]. **Validation:** * Source-level integrity confirmed for key removal and JSON validation logic[cite: 2]. * The wallet selection sidebar handles malformed JSON securely without crashing the background process[cite: 2].
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
This PR addresses critical secrets management and data handling vulnerabilities within the
linera-webextension. Previously, the extension background script hardcoded a private key literal, silently ignored uploaded wallet files, and retained unvalidated JSON structures in memory. This update removes all embedded key material, strictly validates the shape of imported wallet metadata, and ensures only safe, non-sensitive chain identifiers are retained.Vulnerabilities & Security Defects Remediated:
linera-web/extension/src/wallet/index.ts): Removed the hardcodedPrivateKeyliteral from theServer::setWalletflow. The browser client is now safely disposed of and fails closed if a supported initialization path is unavailable, rather than defaulting to an insecure embedded key[cite: 2].linera-web/extension/src/wallet/index.ts): ImplementedparseWalletMetadatato strictly validate uploaded JSON. The extension now discards the raw file contents and only retains thedefaultchain identifier in memory[cite: 2].linera-web/extension/src/sidebar/index.ts,linera-web/extension/src/wallet/index.ts): Client query failures and malformed wallet uploads are now caught and returned explicitly as errors through the message bridge, preventing uncaught promise rejections and silent UI failures[cite: 2].Validation: