Security/fix critical vulnerabilities #38
Reference in New Issue
Block a user
Delete Branch "security/fix-critical-vulnerabilities"
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?
Security: Fix critical vulnerabilities
Fixes critical security issues identified in security scan:
Fixed Issues:
status.pyand migrationsinnerHTMLwithtextContent/createElementin UI componentsstatusline.cjsintelligence.cjsandmetrics-db.mjswss://in production environmentsChanges:
Testing:
Code Review
3 Issues Found
1.
process.env.NODE_ENVwill crash in browser (ui/config/api.config.js:110)process.envdoes not exist in vanilla browser ES modules — this project has no bundler (webpack/vite) to shim it. This will throwReferenceError: process is not definedand break all WebSocket connections.Fix: Remove the
process.envreference:2.
sanot imported in migration file (v1/src/database/migrations/001_initial.py)sa.text(...)is used inupgrade(),downgrade(), and_insert_initial_data()butimport sqlalchemy as sais never added to this file. It was only added tostatus.py. This will crash withNameError: name 'sa' is not defined.Fix: Add
import sqlalchemy as saat top of001_initial.py.3.
statusline.cjscommand validation may be too restrictiveThe dangerous chars regex blocks
$, backticks, pipes, parens, and quotes. The safe pattern fallback only allowssh -c '...'. Existing callers in the same file likely use pipe chains or subshells. This could silently break the statusline output. Needs testing against actualsafeExec()usage in the file.Looks Good
Thank you @fr4iser90 for these security fixes! All 6 commits have been included in PR #42 which also addresses the
process.envbrowser compatibility issue identified during review.Merged via #42 — your commits are preserved with full attribution in the git history.
Pull request closed