Skip to content

Refactor TorControlPanel for improved security and thread stability#3

Open
sans1924-prog wants to merge 1 commit into
Kicksecure:masterfrom
sans1924-prog:patch-1
Open

Refactor TorControlPanel for improved security and thread stability#3
sans1924-prog wants to merge 1 commit into
Kicksecure:masterfrom
sans1924-prog:patch-1

Conversation

@sans1924-prog

Copy link
Copy Markdown

This PR introduces targeted security and stability improvements to tor_control_panel.py without altering core application logic:

  • Thread Stability: Implemented a _cleanup_bootstrap_thread method to gracefully shut down the bootstrap thread. This replaces abrupt .terminate() calls, significantly reducing the risk of UI deadlocks and memory leaks during Tor restarts or shutdowns.
  • Secure Subprocess Execution: Replaced the insecure os.popen shell execution with a secure subprocess.Popen list-based implementation for reading the Tor log. Added proper UTF-8 decoding for robustness.
  • Credential Masking: Added setEchoMode(QLineEdit.Password) to the proxy password input field to securely mask user credentials while typing.

This pull request changes...

Changes

Mandatory Checklist

  • Legal agreements accepted. By contributing to this organisation, you acknowledge you have read, understood, and agree to be bound by these these agreements:

Terms of Service, Privacy Policy, Cookie Policy, E-Sign Consent, DMCA, Imprint

Optional Checklist

The following items are optional but might be requested in certain cases.

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

Fixes #

This PR introduces targeted security and stability improvements to `tor_control_panel.py` without altering core application logic:

* **Thread Stability:** Implemented a `_cleanup_bootstrap_thread` method to gracefully shut down the bootstrap thread. This replaces abrupt `.terminate()` calls, significantly reducing the risk of UI deadlocks and memory leaks during Tor restarts or shutdowns.
* **Secure Subprocess Execution:** Replaced the insecure `os.popen` shell execution with a secure `subprocess.Popen` list-based implementation for reading the Tor log. Added proper UTF-8 decoding for robustness.
* **Credential Masking:** Added `setEchoMode(QLineEdit.Password)` to the proxy password input field to securely mask user credentials while typing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant