mirror of
https://github.com/atiilla/GeoIntel.git
synced 2026-04-26 16:15:57 +03:00
[PR #16] [MERGED] Potential fix for code scanning alert no. 45: Clear text storage of sensitive information #14
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/GeoIntel#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/atiilla/GeoIntel/pull/16
Author: @atiilla
Created: 3/9/2026
Status: ✅ Merged
Merged: 3/9/2026
Merged by: @atiilla
Base:
main← Head:alert-autofix-45📝 Commits (1)
130096aPotential fix for code scanning alert no. 45: Clear text storage of sensitive information📊 Changes
1 file changed (+4 additions, -2 deletions)
View changed files
📝
geointel_ui_template/index.html(+4 -2)📄 Description
Potential fix for https://github.com/atiilla/GeoIntel/security/code-scanning/45
General approach: avoid persisting the raw API key in browser storage. If we can’t introduce a secure encryption key distinct from the API key itself, client‑side encryption would be effectively security‑through‑obscurity. The safest change, without adding a backend, is to keep the API key only in memory for the lifetime of the page and stop writing it to
sessionStorage. We can still store the selected model inlocalStoragebecause that’s not sensitive.Concrete fix:
let inMemoryApiKey = null;) to hold the current key.getStoredApiKeyandstoreApiKeyso they no longer touchsessionStorage. Instead:storeApiKey(key)assigns toinMemoryApiKeyand updates indicators.getStoredApiKey()just returnsinMemoryApiKey.sessionStorage.setItem/.getItemfor the API key.getStoredApiKey, and the UI indicator logic remains the same.window.loadthat callsupdateApiKeyIndicator()and conditionally opens the modal will still work, but nowgetStoredApiKey()returns a value only after the user has entered a key in this session (which is desirable).All changes are contained in
geointel_ui_template/index.htmlwithin the shown script section, around the API key helper functions.Suggested fixes powered by Copilot Autofix. Review carefully before merging.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.