Skip to content

Security Fixes: SQL Injection, Command Injection, SSL Verification#181

Open
GuillaumeLeone8 wants to merge 1 commit intoPantsuDango:masterfrom
GuillaumeLeone8:security-fixes
Open

Security Fixes: SQL Injection, Command Injection, SSL Verification#181
GuillaumeLeone8 wants to merge 1 commit intoPantsuDango:masterfrom
GuillaumeLeone8:security-fixes

Conversation

@GuillaumeLeone8
Copy link
Copy Markdown

This PR addresses several critical security vulnerabilities:

Fixes Applied

1. SQL Injection (utils/sqlite.py)

  • Function: selectTranslationDBList() and selectTranslationDBTotal()
  • Issue: User input was directly interpolated into SQL queries using string formatting
  • Fix: Replaced with parameterized queries using ? placeholders

2. OS Command Injection (utils/offline_ocr.py)

  • Function: killOfflineOCR()
  • Issue: User-controlled port variable was interpolated into shell commands
  • Fix: Replaced os.popen() with subprocess.run() using list arguments to prevent shell injection

3. SSL Verification Disabled (utils/http.py)

  • Functions: post() and getOCR()
  • Issue: verify=False disabled SSL certificate validation, making connections vulnerable to MITM attacks
  • Fix: Changed verify=False to verify=True and removed disable_warnings() call

Security Impact

These fixes prevent:

  • Data exfiltration via SQL injection
  • Remote code execution via command injection
  • Man-in-the-middle attacks due to disabled SSL verification

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