Skip to content

Potential fix for code scanning alert no. 10: Clear text storage of sensitive information - #5

Merged
albert-mueller merged 1 commit into
mainfrom
alert-autofix-10
Aug 6, 2026
Merged

Potential fix for code scanning alert no. 10: Clear text storage of sensitive information#5
albert-mueller merged 1 commit into
mainfrom
alert-autofix-10

Conversation

@albert-mueller

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/albert-mueller/albert-mueller.github.io/security/code-scanning/10

Best fix: stop storing API credentials in localStorage. Keep non-sensitive settings persisted, but force apiKey/apiSecret fields to empty strings before serialization in both saveSettings() and saveApiConfig(service). This preserves app behavior for toggles and non-secret preferences while removing cleartext secret persistence. It also addresses all 5 alert variants in one change because every flagged source flows into these two storage writes.

Edit only others/translate/app.js in:

  • saveSettings() object construction (apiServices.baidu/youdao/google sections): replace secret fields with ''.
  • saveApiConfig(service) switch cases for baidu, youdao, and google: replace persisted apiKey/apiSecret values with '' while keeping enabled and appId persistence unchanged.

No new imports/dependencies are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Albert Müller <p8bpg9zrw7@privaterelay.appleid.com>
@albert-mueller
albert-mueller marked this pull request as ready for review August 6, 2026 00:41
@albert-mueller
albert-mueller merged commit 199a105 into main Aug 6, 2026
2 checks passed
@albert-mueller
albert-mueller deleted the alert-autofix-10 branch August 6, 2026 02:20
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.

1 participant