Skip to content

fix: resolve multiple DOM-based XSS and Electron security vulnerabilities#179

Open
Akshita-2307 wants to merge 1 commit into
siddu-k:mainfrom
Akshita-2307:fix/security-xss-electron-protocol
Open

fix: resolve multiple DOM-based XSS and Electron security vulnerabilities#179
Akshita-2307 wants to merge 1 commit into
siddu-k:mainfrom
Akshita-2307:fix/security-xss-electron-protocol

Conversation

@Akshita-2307
Copy link
Copy Markdown

Summary

This PR addresses 4 security vulnerabilities in bashmanager:

1. #168 – Incomplete HTML attribute escaping in escapeAttr()

The escapeAttr() function only escaped " and ' but not &, <, or >, allowing HTML/attribute injection through unescaped special characters.

2. #172 – Electron setWindowOpenHandler allows file:// and data: protocol loading

The handler allowed any URL not starting with http, enabling local file disclosure and arbitrary JS execution via file:// and data: URLs.

3. #169 – window.open missing noopener flag

Server-provided URLs opened with window.open without noopener,noreferrer, making the app vulnerable to reverse tabnabbing.

4. #167 – Stored XSS via unsanitized onclick injection in sidebar

Script names and relative_path values were interpolated directly into onclick handler strings without proper escaping.

Fixes #168, #172, #169, #167

…ties

- escapeAttr: escape &, <, > characters to prevent HTML/attribute injection
- setWindowOpenHandler: deny non-http URLs (file://, data:) to stop local file disclosure
- window.open: add noopener,noreferrer to prevent reverse tabnapping
- onclick handlers: sanitize script paths and category names to prevent stored XSS
@Akshita-2307
Copy link
Copy Markdown
Author

Hi maintainers! This PR resolves multiple DOM-based XSS vulnerabilities and Electron security issues identified in the codebase. Includes proper input sanitization and secure IPC communication patterns. Would appreciate a review. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: escapeAttr() Does Not Escape HTML Special Characters

2 participants