Skip to content

🛡️ Security Hardening, Privacy & Navigation Optimization#1

Open
EduSouza-programmer wants to merge 3 commits intoPleasePrompto:mainfrom
EduSouza-programmer:security-hardening-and-maintenance
Open

🛡️ Security Hardening, Privacy & Navigation Optimization#1
EduSouza-programmer wants to merge 3 commits intoPleasePrompto:mainfrom
EduSouza-programmer:security-hardening-and-maintenance

Conversation

@EduSouza-programmer
Copy link
Copy Markdown

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

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