Fix: Secure Credential Transmission and Client-Side Storage via Frontend Hashing#149
Open
ArshVermaGit wants to merge 2 commits into
Open
Fix: Secure Credential Transmission and Client-Side Storage via Frontend Hashing#149ArshVermaGit wants to merge 2 commits into
ArshVermaGit wants to merge 2 commits into
Conversation
ArshVermaGit
commented
May 28, 2026
Contributor
Author
|
@siddu-k conflicts are resolved please review and merge |
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.
Overview
This pull request eliminates a Medium severity vulnerability involving plaintext transmission and globally accessible storage of script unlock passwords.
Previously, when a user entered a password to unlock a script, the raw plaintext password was kept in a global JavaScript
Map(unlockCredentials) and transmitted over HTTP in plain text. This exposed the credentials to network interception and trivially allowed DOM-Based XSS payloads to exfiltrate them from memory.Resolved Issue
Resolves #148
Root Cause
The frontend relied exclusively on the backend to perform cryptographic hashing (PBKDF2), meaning the plaintext secret had to traverse the network unencrypted (if not using HTTPS) and sit in the browser memory for the duration of the session.
Changes
ui/app.jshashPassword(plainText)function that resolves to a secure SHA-256 hash.unlockCredentialsMap withCredentialStore, a self-invoking function closure. The internal map is no longer exposed to thewindownamespace.hashPassword(). TheCredentialStoreonly caches theSHA-256hash, and API requests to/api/scripts/runand/api/scripts/lockonly transmit the hash.locks.json(Backend Migration)SHA-256hashes instead of plaintext passwords, existing PBKDF2 hashes generated from plaintext passwords can no longer be validated.locks.jsonfile. The backend logic securely adapts out-of-the-box by computingPBKDF2(SHA-256(password))for all new locks.Security Impact
SHA-256hash. Passwords are never sent in plain text.unlockCredentialsglobally and steal plaintext secrets.