security: Fix critical & high-risk vulnerabilities#41
Open
realmrhigh wants to merge 4 commits into
Open
Conversation
…on all sensitive agent files and dirs
… downloaded browser binaries
…hs to ROTUNDA_OUTPUT_DIR
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.
Security: Fix Critical & High-Risk Vulnerabilities
Overview
This PR addresses 4 critical/high-risk security issues identified during a security audit of the Rotunda browser. These fixes are essential for personal/production use and prevent token theft, binary compromise, MITM attacks, and arbitrary file writes.
Changes
C1: Auth Token Storage (Critical)
Issue: Session tokens stored plaintext in
~/.rotunda/agent/sessions/with default permissionsFix:
0o700(owner-only access)0o600permissions via atomic writesFiles:
src/agent/session_manager.pyC2: Binary Integrity (Critical)
Issue: Downloaded browser binaries never verified; vulnerable to MITM/compromised releases
Fix:
Files:
src/browser/downloader.pyC3: SSL Verification (Critical)
Issue:
verify=Falsein HTTP requests to geolocation/IP endpoints; vulnerable to MITMFix:
verify=FalseparametersFiles:
src/utils/ip_utils.py,src/api/endpoints.pyH2: Path Traversal (High)
Issue: No sanitization on screenshot/download file paths; allows arbitrary file writes
Fix:
_safe_output_path()helper usingos.path.normpath()+.resolve()ROTUNDA_OUTPUT_DIR../, symlinks) fail safelyFiles:
src/api/endpoints.pyTesting
Impact
Commits
Signed-off-by: Stanton High stantonhigh@gmail.com