Skip to content

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

Merged
albert-mueller merged 1 commit into
mainfrom
alert-autofix-12
Aug 5, 2026
Merged

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

Conversation

@albert-mueller

Copy link
Copy Markdown
Owner

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

To fix this without changing behavior, build a separate non-sensitive object for persistence instead of cloning apiConfig (which contains secrets). Keep using apiConfig for in-memory runtime setup (setApiKey calls), but construct safeApiConfig directly from non-secret fields only (service, and optionally non-secret identifiers like appId).

Best change in others/translate/translate.js around lines 285–296:

  • Remove JSON.parse(JSON.stringify(apiConfig)) and all subsequent delete statements.
  • Replace with explicit object construction that never includes secretKey/apiKey.
  • Persist only this explicit safe object to localStorage.

This addresses all six alert variants with one change by breaking taint flow from secret inputs to storage sink.

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 5, 2026 23:17
@albert-mueller
albert-mueller merged commit 71469e2 into main Aug 5, 2026
2 checks passed
@albert-mueller
albert-mueller deleted the alert-autofix-12 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