Repository navigation
fix: keep stored secrets out of form HTML (A20) - #124
Merged
Merged
Conversation
Settings loads the webhook secret from the API on Show/Copy. The app edit form gets an empty basic-auth password (empty keeps it, empty username removes auth) and secret env values masked (empty + original key); the handler keeps the stored value unless it is changed, also when the row is renamed or made plain. JSON API unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e could be overwritten) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
Author
|
Opus review (read-only, go test/vet green): no blocking findings. Confirmed: no stored secret reaches HTML (incl. error re-renders), clients without |
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.
Audit finding A20 (pre-revamp): stored secrets were rendered into page HTML.
GET api/settings/webhook-secret; Roll unchanged.unchanged. Empty keeps the stored password; a new value replaces it; an empty Username removes basic auth (and clears the password). Hint text says so. The add form still echoes the just-typed value on a validation error (user input, nothing stored yet).{value:"", masked:true, orig:KEY}. The form postsenv_origper row;saveFormEnvVarskeeps the stored value for an untouched masked row, also when the row was renamed or switched to plain (on main both of those wiped the value). Export in the env card fetches masked values fromGET api/apps/{id}/secretsonly when clicked.Evidence:
TestSecretsNotInFormHTML(fails on main with 9 errors, passes here):/settingsand/apps/{id}/editHTML contain neither the webhook secret, the auth password nor secret env values; edit with empty password keeps it; rename / make-plain of masked rows keeps values; removed row deleted; new password replaces; empty username clears auth.unchanged, Export shows real values, Save without changes keepsauth_passand secrets (checked via API), no pageerror.go build ./... && go vet ./... && go test ./...OK;tests/e2e/ui.mjsPASS.🤖 Generated with Claude Code