Skip to content

Refactor: Secure literal search and defensive scope handling#4492

Open
mhdnazrul wants to merge 3 commits into
ChrisTitusTech:mainfrom
mhdnazrul:fix-search-security
Open

Refactor: Secure literal search and defensive scope handling#4492
mhdnazrul wants to merge 3 commits into
ChrisTitusTech:mainfrom
mhdnazrul:fix-search-security

Conversation

@mhdnazrul
Copy link
Copy Markdown

@mhdnazrul mhdnazrul commented May 14, 2026

Type of Change

  • Bug fix
  • UI/UX improvement

Description

This Pull Request addresses two critical security and stability issues found in the search functionality of both the Install (Apps tabs) and Tweaks tabs.

1. Fix: Apps Search Wildcard Injection & Scope Handling

  • Issue: Inputting special characters (e.g., [, *, {) triggered PowerShell wildcard errors, causing terminal crashes and UI freezes.
  • Fix: Implemented literal string matching using .IndexOf() and handled the $sync object's scope more defensively to ensure it's always accessible.

2. Fix: Tweaks Search Hardening & PS 5.1 Compatibility

  • Issue: The Tweaks search suffered from the same wildcard injection vulnerability. Additionally, certain modern PowerShell syntax (ternary operators) caused syntax errors on Windows PowerShell 5.1.
  • Fix:
    • Replaced all -like operators with safe literal matching.
    • Standardized the code to be fully compatible with PowerShell 5.1 (removed ? : syntax).
    • Added robust null-checks for the tweaks panel and its child elements to prevent race condition crashes.
    • Improved UI logic for category labels (safe conversion of + to - prefixes).

Visual Proof

A. Apps Tab (Install Tab)

Before (The Error):
Screenshot 2026-05-15 041849

After (The Fix):
Screenshot 2026-05-15 042601

B. Tweaks Tab

Before (The Error):
Screenshot 2026-05-15 055121

After (The Fix):
Screenshot 2026-05-15 055024


Issue related to PR

  • Resolves # None (Direct contribution)

@mhdnazrul mhdnazrul requested a review from ChrisTitusTech as a code owner May 14, 2026 22:30
@github-actions github-actions Bot added bug Something isn't working ui update UI/UX improvements labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ui update UI/UX improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant