🛡️ Security Hardening, Privacy & Navigation Optimization#1
Open
EduSouza-programmer wants to merge 3 commits intoPleasePrompto:mainfrom
Open
🛡️ Security Hardening, Privacy & Navigation Optimization#1EduSouza-programmer wants to merge 3 commits intoPleasePrompto:mainfrom
EduSouza-programmer wants to merge 3 commits intoPleasePrompto:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request addresses a critical security vulnerability and introduces maintenance features to enhance user privacy, control over Google session data, and overall navigation stability.
🔐 Fixed Issues
Path Traversal Vulnerability (Critical): The save_to_file feature previously allowed unsanitized filenames. This has been fixed by integrating path.basename() in ToolHandler.ts to ensure all file operations are strictly confined to the designated results directory, preventing arbitrary file write attempts.
🚀 New Features & Enhancements
Browser Profile Cleanup Tool: Added a new MCP tool clear_browser_profile. This allows users to securely wipe the persistent Chrome profile (cookies, session, cache). It addresses privacy concerns regarding persistent Google logins and provides an automated way to reset the search environment.
Navigation Stability Optimization: Switched the browser's navigation wait strategy from domcontentloaded to networkidle in SearchHandler.ts.
📈 Performance & UX Benefits
History Spam Prevention: Consolidates internal Google redirects and state updates into a clean, singular history entry. This avoids the "spam" of 4+ identical entries for a single search.
reCAPTCHA Mitigation: By ensuring the network is stable before interaction, the traffic pattern appears more "human-like" to Google's WAF (Web Application Firewall), significantly reducing the frequency of automated reCAPTCHA challenges triggered by fragmented requests.
🛠️ Technical Changes
src/tools/search-tool.ts
: Registered the clear_browser_profile tool definition.
src/tools/tool-handler.ts
: Implemented robust profile wiping logic (with process termination and OS-specific lock handling) and added path sanitization.
src/search/search-handler.ts
: Optimized page.goto logic to wait for network stability.
src/index.ts
: Updated the MCP server to route the new tool reque