fix(security): resolve ~14 JavaScript CodeQL alerts (#3164)#3183
fix(security): resolve ~14 JavaScript CodeQL alerts (#3164)#3183mrveiss merged 2 commits intoDev_new_guifrom
Conversation
- js/incomplete-multi-character-sanitization: .replace('_',' ') → .replaceAll('_',' ')
- js/insecure-randomness: Math.random() → crypto.randomUUID()/getRandomValues()
- js/prototype-pollution-utility: add __proto__/constructor/prototype guards
- js/clear-text-storage-of-sensitive-data: move auth tokens to sessionStorage
- js/reflected-xss: escape dynamic values in innerHTML templates
- js/shell-command-injection-from-environment: add validation + suppression comment
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code reviewFound 1 issue:
AutoBot-AI/autobot-frontend/src/utils/cacheManagement.ts Lines 7 to 11 in e1b773e The existing duplicate (for reference): https://github.com/mrveiss/AutoBot-AI/blob/e1b773ed3b084470cae603d16390a99bf84ab1f1/autobot-frontend/src/components/analytics/CodeGenerationDashboard.vue Note: the 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Code reviewFound 1 issue:
AutoBot-AI/autobot-slm-frontend/src/stores/auth.ts Lines 39 to 44 in e1b773e 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Migrate remaining 14 files from localStorage.getItem('slm_access_token')
to sessionStorage to match the token write migration in auth.ts, preventing
null token reads and 401 errors across the SLM frontend.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Alert types fixed
js/incomplete-multi-character-sanitization.replace('_', ' ')→.replaceAll('_', ' ')js/insecure-randomnessMath.random()→crypto.randomUUID()/crypto.getRandomValues()js/prototype-pollution-utility__proto__/constructor/prototypekey guards informHelpers.tsjs/clear-text-storage-of-sensitive-datalocalStoragetosessionStoragejs/reflected-xssescapeHtml()applied to dynamic values ininnerHTMLtemplatesjs/shell-command-injection-from-environmentFiles changed (14)
autobot-slm-frontend/src/views/DeploymentsView.vue— replaceAll fix (4 locations)autobot-slm-frontend/src/views/performance/AlertRulesView.vue— replaceAll fixautobot-frontend/src/utils/formHelpers.ts— prototype pollution guardsautobot-frontend/src/services/GlobalWebSocketService.ts— crypto.getRandomValuesautobot-frontend/src/services/LiveEventService.ts— crypto.getRandomValuesautobot-frontend/src/components/chat/ChatInput.vue— crypto.randomUUIDautobot-frontend/src/stores/useAppStore.ts— crypto.randomUUIDautobot-frontend/src/plugins/errorHandler.ts— crypto.randomUUIDautobot-frontend/src/types/settings.ts— crypto.randomUUIDautobot-frontend/src/utils/cacheManagement.ts— escapeHtml for innerHTMLautobot-slm-frontend/src/stores/auth.ts— sessionStorage for tokensautobot-slm-frontend/src/views/LoginView.vue— sessionStorageautobot-slm-frontend/src/views/SSOCallbackView.vue— sessionStorage.mcp/autobot-mcp-server.js— input validation + suppressionTest plan
🤖 Generated with Claude Code