Skip to content

fix: prevent path traversal in extract_har.py (fixes #320) - #337

Closed
KooshaPari wants to merge 1 commit into
simonw:mainfrom
KooshaPari:fix-320-path-traversal
Closed

KooshaPari wants to merge 1 commit into
simonw:mainfrom
KooshaPari:fix-320-path-traversal

Conversation

@KooshaPari

Copy link
Copy Markdown

Fixes #320

Changes

  • Added is_safe_path() helper to verify output paths resolve within the output directory
  • Added path traversal sanitization in extract_path_from_url() to strip ../ components
  • Added security check before writing each file to prevent directory traversal attacks
  • Skips files with unsafe paths and logs a warning instead of crashing

Copilot AI lite review requested due to automatic review settings September 13, 2026 05:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@KooshaPari KooshaPari closed this by deleting the head repository Sep 14, 2026
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.

Arbitrary file write / Path traversal in python/extract_har.py

2 participants