Skip to content

Security: restore stored secrets only for the same widget type and destination - #484

Merged
SandObserver merged 1 commit into
mainfrom
security/secret-restore-scope
Oct 17, 2026
Merged

SandObserver merged 1 commit into
mainfrom
security/secret-restore-scope

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Run migrate on the incoming config before preserveAllSecrets in POST /api/config, so a legacy widget type is renamed before secrets are matched.
  • Refill a widget secret only when the stored item is a widget of the same widgetType, in preserveAllSecrets and in POST /api/widget-options.
  • Count a removed or emptied settings.server.portMap as a rewrite change in rewriteChanged.
  • Withhold stored widget secrets when settings.server.skipTlsVerify is turned on or off.
  • List a widget with no manifest in withheld when a rewrite or certificate change clears its stored config.

Testing
All green. Added 9 tests covering legacy-type saves, type changes on save and options fetch, port map removal, the global certificate skip and withheld unknown widgets.

Changelog

Security

  • Keep a stored widget secret out of the browser when a save sends the widget under a legacy type.
  • Withhold stored secrets when a widget's type changes, the port map is removed, or certificate checking for widgets is turned on or off.

Fixed

  • Name a widget without a manifest for re-entry when a port map change clears its settings.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.

Run migrations on an incoming config before refilling secrets, and refill a
widget secret only when the stored item has the same widget type. Count a
removed or emptied port map, and a change of the global certificate skip, as
a destination change. Name a withheld widget with no manifest when a rewrite
change clears its config.
@SandObserver SandObserver added the security Security fix label Oct 17, 2026
@SandObserver
SandObserver merged commit eed523a into main Oct 17, 2026
6 checks passed
@SandObserver
SandObserver deleted the security/secret-restore-scope branch October 17, 2026 23:26
stackyard-release Bot pushed a commit that referenced this pull request Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Security fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant