Skip to content

Conversation

@severmanolescu
Copy link
Owner

This commit addresses HIGH SEVERITY security issues identified by CodeQL:

  1. Command Injection (apps.js:229-237):

    • Replaced exec() with spawn() to prevent command injection
    • User-controlled app.path no longer goes through shell interpreter
    • Added proper process detachment and error handling
  2. XSS Vulnerabilities (multiple files):

    • Added escapeHtml() utility function to sanitize user-controlled data
    • Fixed innerHTML injections in:
      • ui-components.js - app names, categories, icon filenames
      • navigation.js - category names and icon filenames * heatmap.js - app names in labels * app-details.js - icon filenames
    • All user-controlled data (app names, category names, file paths) is now properly escaped before being inserted into innerHTML

Security improvements prevent arbitrary code execution from:

  • Malicious application paths stored in database
  • Crafted app names or categories containing script tags
  • Icon filenames with XSS payloads

🤖 Generated with Claude Code

severmanolescu and others added 7 commits October 3, 2025 16:44
This commit addresses HIGH SEVERITY security issues identified by CodeQL:

1. Command Injection (apps.js:229-237):
   - Replaced exec() with spawn() to prevent command injection
   - User-controlled app.path no longer goes through shell interpreter
   - Added proper process detachment and error handling

2. XSS Vulnerabilities (multiple files):
   - Added escapeHtml() utility function to sanitize user-controlled data
   - Fixed innerHTML injections in:
     * ui-components.js - app names, categories, icon filenames
     * navigation.js - category names and icon filenames
     * heatmap.js - app names in labels
     * app-details.js - icon filenames
   - All user-controlled data (app names, category names, file paths) is now
     properly escaped before being inserted into innerHTML

Security improvements prevent arbitrary code execution from:
- Malicious application paths stored in database
- Crafted app names or categories containing script tags
- Icon filenames with XSS payloads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sanitize user-controlled data in analytics page:
- App names in top apps list
- App names in all applications grid
- Category names in category breakdown
- Icon filenames in image sources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sanitize app name in longest session insight display.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Set publish to null to prevent electron-builder from trying to publish
to GitHub releases during local builds. This prevents the GH_TOKEN error.

Publishing is handled separately by the release.yml workflow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Added CSC_IDENTITY_AUTO_DISCOVERY: false to ci.yml
- Added CSC_IDENTITY_AUTO_DISCOVERY: false to release.yml
- Reverted publish: null from package.json to allow releases
- Re-added ZIP target for releases

This prevents code signing errors while still allowing the release
workflow to upload builds to GitHub releases.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
electron-builder will no longer try to auto-publish to GitHub.
Release workflow uses softprops/action-gh-release to attach builds.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@severmanolescu severmanolescu merged commit bae03b0 into master Oct 3, 2025
5 checks passed
@severmanolescu severmanolescu deleted the security/fix-code-scanning-alerts branch October 3, 2025 14:03
@severmanolescu severmanolescu added the bug Something isn't working label Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants