Skip to content

KC-1504, KC-1519: Fix Nested Share Folder path resolution ownership bypass, and Prevent duplicate folder names from routing records into attacker-owned shared folders - #2445

Open
sshrushanth-ks wants to merge 4 commits into
nsf-folder-path-resolution-fixfrom
nsf-folder-path-resolution-fix-int
Open

sshrushanth-ks wants to merge 4 commits into
nsf-folder-path-resolution-fixfrom
nsf-folder-path-resolution-fix-int

Conversation

@sshrushanth-ks

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

Copy link
Copy Markdown
Contributor

Summary

  1. An attacker-owned Nested Share Folder could shadow a victim’s folder path and cause record keys to be wrapped under the attacker’s folder key. Added ownership-aware path resolution, owned-record precedence, and ambiguity handling.

  2. Duplicate classic folder names could cause record-add, cd, mv, and related commands to select the first matching folder. Added fail-closed folder resolution and prevented record-add from creating unfiled records when --folder is ambiguous or invalid.

Changes

  • keepercommander/nested_share_folder/folder_api.py: Added ownership-aware NSF path and folder resolution; reject unowned NSF folders found through folder_cache.
  • keepercommander/nested_share_folder/removal_api.py: Prefer owned records, reject ambiguous record titles, and centralize secure folder resolution.
  • keepercommander/commands/nested_share_folder/display_commands.py: Restrict nsf-get folder resolution to Nested Share Folders.
  • keepercommander/commands/nested_share_folder/folder_commands.py: Preserve ownership metadata for newly created NSF folders.
  • keepercommander/subfolder.py: Detect ambiguous folder paths and raise a dedicated ambiguity error instead of selecting the first match.
  • keepercommander/commands/base.py: Make shared folder resolution fail closed on ambiguous paths.
  • keepercommander/commands/folder.py: Apply ambiguity handling to cd, mv, ln, mkdir, and rndir.
  • keepercommander/commands/record_edit.py: Reject record-add --folder when the folder cannot be resolved.
  • unit-tests/test_nested_share_folder.py: Add NSF ownership, path-shadowing, record ambiguity, and legacy-folder regression tests.
  • unit-tests/test_subfolder.py: Add duplicate folder path resolution tests.
  • unit-tests/test_command_record.py: Add regression coverage preventing unfiled record creation for unresolved folders.

Prevent attacker-owned shared-in folders from shadowing victim folder
paths during NSF record operations. Restrict name resolution to owned
folders, prefer owned records during title lookup, reject ambiguous
matches, and add regression coverage for record creation and resolution.
@sshrushanth-ks sshrushanth-ks self-assigned this Oct 16, 2026
@sshrushanth-ks
sshrushanth-ks marked this pull request as ready for review October 16, 2026 12:01

@adeshmukh-ks adeshmukh-ks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

working on additional changes

and reject path results containing unowned NSF folders.

Add regression coverage for attacker-owned NSF folders present in
folder_cache.
…folder path components match multiple folders instead of selecting the first result.

Prevent record-add from creating unfiled records when --folder cannot be
resolved, and add regression coverage for duplicate folder names across
record and folder commands.
@sshrushanth-ks sshrushanth-ks changed the title KC-1504: Fix Nested Share Folder path resolution ownership bypass KC-1504, KC-1519: Fix Nested Share Folder path resolution ownership bypass, Prevent duplicate folder names from routing records into attacker-owned shared folders Oct 23, 2026
@sshrushanth-ks sshrushanth-ks changed the title KC-1504, KC-1519: Fix Nested Share Folder path resolution ownership bypass, Prevent duplicate folder names from routing records into attacker-owned shared folders KC-1504, KC-1519: Fix Nested Share Folder path resolution ownership bypass, and Prevent duplicate folder names from routing records into attacker-owned shared folders Oct 23, 2026

This branch has not been deployed

No deployments
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