Fix secret variable disclosure in edit and release views - #14
Open
DeveloperDurp wants to merge 1 commit into
Open
Fix secret variable disclosure in edit and release views#14DeveloperDurp wants to merge 1 commit into
DeveloperDurp wants to merge 1 commit into
Conversation
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.
Motivation
valueand into release detail rows, exposing secrets in HTML/DOM despite the newsecretflag.Description
variableEditValue(variable db.Variable) stringtoviews/pages/variables.templto return an empty string for secret variables and used it for the edit-rowvalueattribute, and updated the placeholder toLeave blank to keep existing secret.internal/handler/variable.goUpdateVariableto load the current variable and preserve its stored value whensecretremains set and the submittedvalueis blank, so clients can omit the secret on submit without losing it.Secretflag so the edit UI state remains correct on validation errors.views/pages/releases.templso release detail pages display bullets for secret values instead of the stored plaintext.Testing
variableEditValue, the new placeholder text, and the release template masksv.Secret) which passed.templ generatebut it failed in this environment becausetempl/module downloads are not available here, so generated*_templ.gocould not be produced locally.go test -v -count=1 ./...which ran many package tests (notablyinternal/db,internal/auth,internal/repository,internal/runner,internal/notify,internal/migrate,internal/secret, and others) and those package tests passed; the full test run failed to build packages that require generated templ files and the embeddedswagger-uiassets (e.g.,cmd/server,internal/server,internal/handler,internal/handler/api, andstatic) because of the missing generated files and swagger assets, which is expected on a fresh checkout withouttempl generate/make swagger-ui-copy.Codex Task