Skip to content

KC-1500: Fix path traversal in download-attachment with attacker-named shared folders - #2442

Merged
sk-keeper merged 1 commit into
releasefrom
KC-1500
Oct 23, 2026
Merged

sk-keeper merged 1 commit into
releasefrom
KC-1500

Conversation

@sshrushanth-ks

@sshrushanth-ks sshrushanth-ks commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

download-attachment --preserve-dir could write attachments outside --out-dir when an attacker-controlled shared-folder name was an absolute path. Validated the resolved preserved-directory path before creating directories or downloading files, and raise CommandError if it escapes the requested output directory.

Changes

  • keepercommander/commands/record_edit.py: Added a containment check for preserved attachment directories, rejecting absolute paths, traversal attempts, and cross-drive paths before directory creation or file download.

@sshrushanth-ks sshrushanth-ks self-assigned this Oct 15, 2026
@sshrushanth-ks
sshrushanth-ks marked this pull request as ready for review October 15, 2026 06:13
@sk-keeper
sk-keeper merged commit db84f0a into release Oct 23, 2026
4 checks passed
@sk-keeper
sk-keeper deleted the KC-1500 branch October 23, 2026 15:57
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.

2 participants