Skip to content

ryanflannery fix: prevent secret exposure in settings API responses - #60

Open
ryanvflannery wants to merge 2 commits into
openswarm-ai:mainfrom
ryanvflannery:ryanflannery/fix/settings-secret-redaction
Open

ryanflannery fix: prevent secret exposure in settings API responses#60
ryanvflannery wants to merge 2 commits into
openswarm-ai:mainfrom
ryanvflannery:ryanflannery/fix/settings-secret-redaction

Conversation

@ryanvflannery

Copy link
Copy Markdown

Summary

Redacts sensitive settings values returned by the settings API.

Changes

  • Mask API keys returned from settings responses (Anthropic, OpenAI, Google, OpenRouter, subscription tokens, etc.)
  • Remove openswarm_bearer_token from settings responses
  • Preserve existing stored secrets when masked values are submitted through settings updates
  • Continue displaying masked values in the UI so users can see when a key is configured

Testing

  • Verified masked values are returned by GET /api/settings
  • Verified settings updates continue working through PUT /api/settings
  • Verified masked values do not overwrite stored secrets
  • Verified values persist correctly in settings.json
  • Verified OpenSwarm UI loads and displays masked secrets correctly

@ryanvflannery
ryanvflannery force-pushed the ryanflannery/fix/settings-secret-redaction branch from 6407ffe to 1485171 Compare June 4, 2026 09:20
@ciregenz

Copy link
Copy Markdown
Collaborator

Settings secret redaction has since shipped (backend/apps/settings/redaction.py), resolving the exposure this targeted (#46). Closing as superseded, thank you for the security fix.

@ciregenz ciregenz closed this Jun 28, 2026
@ciregenz

Copy link
Copy Markdown
Collaborator

Reopening, I closed this in error. I'd assumed it was superseded by backend/apps/settings/redaction.py, but that only redacts the SettingsRead MCP tool; the actual HTTP endpoint GET /api/settings (backend/apps/settings/settings.py:116) still returns the full model_dump() with every provider key plus the bearer token, unredacted. So this PR's mask-on-read / preserve-on-masked-write fix is still needed (see the PUT-clobber trap noted in the issue). Apologies for the noise.

@ciregenz ciregenz reopened this Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants